You’re part of a group

Switch to your group space and start collaborating with your teammates.

You’re part of a group

Switch to your group space and start collaborating with your teammates.














Sign up
Workspace

Project: Exploring NYC Public School Test Result Scores

0
Beta
Spinner

Photo by Jannis Lucas on Unsplash.

Every year, American high school students take SATs, which are standardized tests intended to measure literacy, numeracy, and writing skills. There are three sections - reading, math, and writing, each with a maximum score of 800 points. These tests are extremely important for students and colleges, as they play a pivotal role in the admissions process.

Analyzing the performance of schools is important for a variety of stakeholders, including policy and education professionals, researchers, government, and even parents considering which school their children should attend.

You have been provided with a dataset called schools.csv, which is previewed below.

You have been tasked with answering three key questions about New York City (NYC) public school SAT performance.

# Title: Analysis of School Data

# Summary: This Python code loads a dataset of school information and performs several data analysis tasks. It begins by identifying schools with average math scores exceeding 80% of the maximum possible score. It then calculates the total SAT scores for each school and identifies the top 10 schools with the highest total SAT scores. Finally, the code groups schools by borough and determines the borough with the largest standard deviation in total SAT scores, providing a valuable overview of school performance and regional disparities.

# Re-run this cell
import pandas as pd

# Read in the data
schools = pd.read_csv("schools.csv")

# Preview the data
schools.head()

# Get the list of column names in the DataFrame
column_names = schools.columns.tolist()
print(column_names)

# Set a maximum score and percentage threshold
max_score = 800
percent_threshold = 0.8

# Calculate the score threshold at 80% of the maximum score
score_80_threshold = percent_threshold * max_score
print(score_80_threshold)

# Find schools with an average math score greater than or equal to the threshold
best_math_schools = schools[['school_name','average_math']][schools['average_math'] >= score_80_threshold].sort_values(by='average_math', ascending=False)

# Calculate the total SAT score for each school
schools['total_SAT'] = schools['average_math'] + schools['average_reading'] + schools['average_writing']

# Get the updated list of column names
column_names = schools.columns.tolist()
print(column_names)

# Find the top 10 schools with the highest total SAT scores
top_10_schools = schools[['school_name','total_SAT']].sort_values(by='total_SAT',
                                                                  ascending=False).head(10)
print(top_10_schools)

# Group schools by borough and calculate count, mean, and standard deviation of total SAT scores
borough_groups = schools.groupby('borough')['total_SAT'].agg(['count',
                                                              'mean',
                                                              'std']).round(2)

# Find the borough with the largest standard deviation
largest_std_dev = borough_groups[borough_groups['std'] == borough_groups['std'].max()]

# Rename the columns for clarity
column_names = {'count':'num_schools', 
                'mean':'average_SAT',
                'std':'std_SAT'}
largest_std_dev = largest_std_dev.rename(columns=column_names)
print(largest_std_dev)

online_sports_revenue[['listing_price', 'price_labels']][online_sports_revenue['price_labels'].isnull()]

  • AI Chat
  • Code