Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Compute Average Test Scores by School District | Statistical Analysis for Policy Evaluation
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Python for Government Analysts

bookChallenge: Compute Average Test Scores by School District

Understanding the average test scores by school district is a crucial step in evaluating the effectiveness of education policies. By examining how students perform across different districts, policymakers can identify areas that may require additional resources or targeted interventions. This type of analysis helps ensure that educational opportunities are equitable and that no district is left behind due to systemic disparities.

1234567891011
students = [ {"district": "North", "test_score": 82}, {"district": "South", "test_score": 77}, {"district": "North", "test_score": 91}, {"district": "East", "test_score": 68}, {"district": "South", "test_score": 85}, {"district": "East", "test_score": 74}, {"district": "West", "test_score": 88}, {"district": "West", "test_score": 92}, {"district": "North", "test_score": 75}, ]
copy

To determine the average test score for each district, you need to group students by their district and then calculate the mean score for each group. This process involves iterating through the dataset, collecting scores for each district, and then dividing the total score by the number of students in that district. Such aggregation is a common technique in data analysis, allowing you to summarize complex datasets and extract actionable insights for policy evaluation.

Завдання

Swipe to start coding

Given a list of student records, each containing a district and a test score, compute the average test score for each district. Return a dictionary mapping each district to its average score.

  • Initialize structures to track the total score and count of students for each district.
  • Iterate through each student record and update the totals and counts for their district.
  • Compute the average for each district by dividing the total score by the number of students in that district.
  • Return a dictionary with districts as keys and their average scores as values.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 5
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Can you show me how to calculate the average test score for each district using this data?

What would the results look like for each district?

Can you explain how grouping and averaging works in this context?

close

bookChallenge: Compute Average Test Scores by School District

Свайпніть щоб показати меню

Understanding the average test scores by school district is a crucial step in evaluating the effectiveness of education policies. By examining how students perform across different districts, policymakers can identify areas that may require additional resources or targeted interventions. This type of analysis helps ensure that educational opportunities are equitable and that no district is left behind due to systemic disparities.

1234567891011
students = [ {"district": "North", "test_score": 82}, {"district": "South", "test_score": 77}, {"district": "North", "test_score": 91}, {"district": "East", "test_score": 68}, {"district": "South", "test_score": 85}, {"district": "East", "test_score": 74}, {"district": "West", "test_score": 88}, {"district": "West", "test_score": 92}, {"district": "North", "test_score": 75}, ]
copy

To determine the average test score for each district, you need to group students by their district and then calculate the mean score for each group. This process involves iterating through the dataset, collecting scores for each district, and then dividing the total score by the number of students in that district. Such aggregation is a common technique in data analysis, allowing you to summarize complex datasets and extract actionable insights for policy evaluation.

Завдання

Swipe to start coding

Given a list of student records, each containing a district and a test score, compute the average test score for each district. Return a dictionary mapping each district to its average score.

  • Initialize structures to track the total score and count of students for each district.
  • Iterate through each student record and update the totals and counts for their district.
  • Compute the average for each district by dividing the total score by the number of students in that district.
  • Return a dictionary with districts as keys and their average scores as values.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 5
single

single

some-alt