### Table of Contents

The outline of your notebook will show up here. You can include headings in any text cell by starting a line with `# `

, `## `

, `### `

, etc., depending on the desired title hierarchy.

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.

```
# Re-run this cell
import pandas as pd
# Read in the data
schools = pd.read_csv("schools.csv")
# Preview the data
schools.head()
```

**What NYC schools have the best math results?** 🤓 Here, I filtered schools that have achieved at least 80% of the maximum possible score (800), then sorted them in descending order. The result is 10 schools as shown below.

```
# Filter schools that have the best math scores
best_math_schools = schools[["school_name", "average_math"]][schools["average_math"] >= 0.8*800].sort_values(by="average_math", ascending=False)
best_math_schools
```

**What are the top 10 performing schools based on the combined SAT scores?** 🔝 We'll create a new column to calculate the sum of math, reading, and writing scores for each school, then sort them in descending order and select the top 10 rows.

```
# Take the sum of math, reading, and writing scores
schools["total_SAT"] = schools[["average_math", "average_reading", "average_writing"]].sum(axis=1)
# Sort and select the top 10 performing schools based on total SAT
top_10_schools = schools[["school_name", "total_SAT"]].sort_values(by="total_SAT", ascending=False)[:10]
top_10_schools
```

**Which single borough has the largest standard deviation in the combined SAT score?** The borough with the greatest standard deviation in the combined SAT score may indicate a wide variation in scores among the schools within that borough. In other words, significant differences in student performance across schools within that particular borough may exist. This information could be valuable for assessing potential disparities in students' performance 🤔

```
# Perform a groupby function to count the number of schools and calculate the average SAT scores along with their standard deviations for each borough
school_borough = schools.groupby("borough")["total_SAT"].agg(["count", "mean", "std"])
school_borough = school_borough.round(2)
school_borough
```

```
# Select the borough with the largest standard deviation
largest_std_dev = school_borough[school_borough["std"] == school_borough["std"].max()]
# Rename columns for better understanding
largest_std_dev.rename(columns={"count": "num_schools", "mean": "average_SAT", "std": "std_SAT"}, inplace=True)
```

It turns out that Manhattan has the largest standard deviation among the boroughs, with 89 schools there. It seems worthwhile to evaluate why this borough exhibits such high disparities in SAT scores.