2022-07-11 21:42:36 -04:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-15 21:14:21 -04:00
|
|
|
"execution_count": 1,
|
2022-07-11 21:42:36 -04:00
|
|
|
"id": "7acc26cb",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2022-07-15 16:22:57 -04:00
|
|
|
"import pandas as pd\n",
|
|
|
|
"import matplotlib.pyplot as plt"
|
2022-07-11 21:42:36 -04:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-15 21:14:21 -04:00
|
|
|
"execution_count": 2,
|
2022-07-11 21:42:36 -04:00
|
|
|
"id": "c821dd0a",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"df = pd.read_csv('https://raw.githubusercontent.com/CunyLaguardiaDataAnalytics/datasets/master/2014-15_To_2016-17_School-_Level_NYC_Regents_Report_For_All_Variables.csv')"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-15 21:14:21 -04:00
|
|
|
"execution_count": 3,
|
2022-07-11 21:42:36 -04:00
|
|
|
"id": "e080ce64",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"(212331, 15)"
|
|
|
|
]
|
|
|
|
},
|
2022-07-15 21:14:21 -04:00
|
|
|
"execution_count": 3,
|
2022-07-11 21:42:36 -04:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"df.shape"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-15 21:14:21 -04:00
|
|
|
"execution_count": 4,
|
2022-07-11 21:42:36 -04:00
|
|
|
"id": "57651a37",
|
|
|
|
"metadata": {
|
|
|
|
"scrolled": true
|
|
|
|
},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"School DBN object\n",
|
|
|
|
"School Name object\n",
|
|
|
|
"School Level object\n",
|
|
|
|
"Regents Exam object\n",
|
|
|
|
"Year int64\n",
|
|
|
|
"Total Tested int64\n",
|
|
|
|
"Mean Score object\n",
|
|
|
|
"Number Scoring Below 65 object\n",
|
|
|
|
"Percent Scoring Below 65 object\n",
|
|
|
|
"Number Scoring 65 or Above object\n",
|
|
|
|
"Percent Scoring 65 or Above object\n",
|
|
|
|
"Number Scoring 80 or Above object\n",
|
|
|
|
"Percent Scoring 80 or Above object\n",
|
|
|
|
"Number Scoring CR object\n",
|
|
|
|
"Percent Scoring CR object\n",
|
|
|
|
"dtype: object"
|
|
|
|
]
|
|
|
|
},
|
2022-07-15 21:14:21 -04:00
|
|
|
"execution_count": 4,
|
2022-07-11 21:42:36 -04:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"df.dtypes"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-15 21:14:21 -04:00
|
|
|
"execution_count": 5,
|
2022-07-11 21:42:36 -04:00
|
|
|
"id": "7147a7d1",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"2015 2017\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# Time range should be 2014-2015 to 2016-2017 school year. Does the 'Year' column reflect this range?\n",
|
|
|
|
"\n",
|
|
|
|
"print(df['Year'].min(), df['Year'].max())"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-15 21:14:21 -04:00
|
|
|
"execution_count": 6,
|
|
|
|
"id": "377a2d08",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"array(['K-8', 'High school', 'Junior High-Intermediate-Middle',\n",
|
|
|
|
" 'Secondary School', 'K-12 all grades', 'Elementary'], dtype=object)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 6,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# What kind of schools are included?\n",
|
|
|
|
"\n",
|
|
|
|
"df['School Level'].unique()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 7,
|
2022-07-11 21:42:36 -04:00
|
|
|
"id": "897e335b",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"School DBN 0\n",
|
|
|
|
"School Name 0\n",
|
|
|
|
"School Level 0\n",
|
|
|
|
"Regents Exam 10\n",
|
|
|
|
"Year 0\n",
|
|
|
|
"Total Tested 0\n",
|
|
|
|
"Mean Score 0\n",
|
|
|
|
"Number Scoring Below 65 0\n",
|
|
|
|
"Percent Scoring Below 65 0\n",
|
|
|
|
"Number Scoring 65 or Above 0\n",
|
|
|
|
"Percent Scoring 65 or Above 0\n",
|
|
|
|
"Number Scoring 80 or Above 0\n",
|
|
|
|
"Percent Scoring 80 or Above 0\n",
|
|
|
|
"Number Scoring CR 0\n",
|
|
|
|
"Percent Scoring CR 0\n",
|
|
|
|
"dtype: int64"
|
|
|
|
]
|
|
|
|
},
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 7,
|
2022-07-11 21:42:36 -04:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# Is there any missing data?\n",
|
|
|
|
"\n",
|
|
|
|
"df.isna().sum()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 8,
|
2022-07-11 21:42:36 -04:00
|
|
|
"id": "e0ab351b",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/html": [
|
|
|
|
"<div>\n",
|
|
|
|
"<style scoped>\n",
|
|
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
|
|
" vertical-align: middle;\n",
|
|
|
|
" }\n",
|
|
|
|
"\n",
|
|
|
|
" .dataframe tbody tr th {\n",
|
|
|
|
" vertical-align: top;\n",
|
|
|
|
" }\n",
|
|
|
|
"\n",
|
|
|
|
" .dataframe thead th {\n",
|
|
|
|
" text-align: right;\n",
|
|
|
|
" }\n",
|
|
|
|
"</style>\n",
|
|
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
|
|
" <thead>\n",
|
|
|
|
" <tr style=\"text-align: right;\">\n",
|
|
|
|
" <th></th>\n",
|
|
|
|
" <th>School DBN</th>\n",
|
|
|
|
" <th>School Name</th>\n",
|
|
|
|
" <th>School Level</th>\n",
|
|
|
|
" <th>Regents Exam</th>\n",
|
|
|
|
" <th>Year</th>\n",
|
|
|
|
" <th>Total Tested</th>\n",
|
|
|
|
" <th>Mean Score</th>\n",
|
|
|
|
" <th>Number Scoring Below 65</th>\n",
|
|
|
|
" <th>Percent Scoring Below 65</th>\n",
|
|
|
|
" <th>Number Scoring 65 or Above</th>\n",
|
|
|
|
" <th>Percent Scoring 65 or Above</th>\n",
|
|
|
|
" <th>Number Scoring 80 or Above</th>\n",
|
|
|
|
" <th>Percent Scoring 80 or Above</th>\n",
|
|
|
|
" <th>Number Scoring CR</th>\n",
|
|
|
|
" <th>Percent Scoring CR</th>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" </thead>\n",
|
|
|
|
" <tbody>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>18654</th>\n",
|
|
|
|
" <td>84M478</td>\n",
|
|
|
|
" <td>Inwood Academy for Leadership Charter School</td>\n",
|
|
|
|
" <td>Secondary School</td>\n",
|
|
|
|
" <td>NaN</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>90</td>\n",
|
|
|
|
" <td>55.6</td>\n",
|
|
|
|
" <td>61</td>\n",
|
|
|
|
" <td>67.8</td>\n",
|
|
|
|
" <td>29</td>\n",
|
|
|
|
" <td>32.2</td>\n",
|
|
|
|
" <td>6</td>\n",
|
|
|
|
" <td>6.7</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>52756</th>\n",
|
|
|
|
" <td>84M478</td>\n",
|
|
|
|
" <td>Inwood Academy for Leadership Charter School</td>\n",
|
|
|
|
" <td>Secondary School</td>\n",
|
|
|
|
" <td>NaN</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>81</td>\n",
|
|
|
|
" <td>55.9</td>\n",
|
|
|
|
" <td>55</td>\n",
|
|
|
|
" <td>67.9</td>\n",
|
|
|
|
" <td>26</td>\n",
|
|
|
|
" <td>32.1</td>\n",
|
|
|
|
" <td>5</td>\n",
|
|
|
|
" <td>6.2</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>52757</th>\n",
|
|
|
|
" <td>84M478</td>\n",
|
|
|
|
" <td>Inwood Academy for Leadership Charter School</td>\n",
|
|
|
|
" <td>Secondary School</td>\n",
|
|
|
|
" <td>NaN</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>9</td>\n",
|
|
|
|
" <td>53.4</td>\n",
|
|
|
|
" <td>6</td>\n",
|
|
|
|
" <td>66.7</td>\n",
|
|
|
|
" <td>3</td>\n",
|
|
|
|
" <td>33.3</td>\n",
|
|
|
|
" <td>1</td>\n",
|
|
|
|
" <td>11.1</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>100865</th>\n",
|
|
|
|
" <td>84M478</td>\n",
|
|
|
|
" <td>Inwood Academy for Leadership Charter School</td>\n",
|
|
|
|
" <td>Secondary School</td>\n",
|
|
|
|
" <td>NaN</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>5</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>na</td>\n",
|
|
|
|
" <td>na</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>100866</th>\n",
|
|
|
|
" <td>84M478</td>\n",
|
|
|
|
" <td>Inwood Academy for Leadership Charter School</td>\n",
|
|
|
|
" <td>Secondary School</td>\n",
|
|
|
|
" <td>NaN</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>54</td>\n",
|
|
|
|
" <td>57.4</td>\n",
|
|
|
|
" <td>34</td>\n",
|
|
|
|
" <td>63</td>\n",
|
|
|
|
" <td>20</td>\n",
|
|
|
|
" <td>37</td>\n",
|
|
|
|
" <td>6</td>\n",
|
|
|
|
" <td>11.1</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>100867</th>\n",
|
|
|
|
" <td>84M478</td>\n",
|
|
|
|
" <td>Inwood Academy for Leadership Charter School</td>\n",
|
|
|
|
" <td>Secondary School</td>\n",
|
|
|
|
" <td>NaN</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>31</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>na</td>\n",
|
|
|
|
" <td>na</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>138300</th>\n",
|
|
|
|
" <td>84M478</td>\n",
|
|
|
|
" <td>Inwood Academy for Leadership Charter School</td>\n",
|
|
|
|
" <td>Secondary School</td>\n",
|
|
|
|
" <td>NaN</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>54</td>\n",
|
|
|
|
" <td>57.3</td>\n",
|
|
|
|
" <td>34</td>\n",
|
|
|
|
" <td>63</td>\n",
|
|
|
|
" <td>20</td>\n",
|
|
|
|
" <td>37</td>\n",
|
|
|
|
" <td>5</td>\n",
|
|
|
|
" <td>9.3</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>138301</th>\n",
|
|
|
|
" <td>84M478</td>\n",
|
|
|
|
" <td>Inwood Academy for Leadership Charter School</td>\n",
|
|
|
|
" <td>Secondary School</td>\n",
|
|
|
|
" <td>NaN</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>36</td>\n",
|
|
|
|
" <td>53.2</td>\n",
|
|
|
|
" <td>27</td>\n",
|
|
|
|
" <td>75</td>\n",
|
|
|
|
" <td>9</td>\n",
|
|
|
|
" <td>25</td>\n",
|
|
|
|
" <td>1</td>\n",
|
|
|
|
" <td>2.8</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>209785</th>\n",
|
|
|
|
" <td>84M478</td>\n",
|
|
|
|
" <td>Inwood Academy for Leadership Charter School</td>\n",
|
|
|
|
" <td>Secondary School</td>\n",
|
|
|
|
" <td>NaN</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>12</td>\n",
|
|
|
|
" <td>59</td>\n",
|
|
|
|
" <td>9</td>\n",
|
|
|
|
" <td>75</td>\n",
|
|
|
|
" <td>3</td>\n",
|
|
|
|
" <td>25</td>\n",
|
|
|
|
" <td>1</td>\n",
|
|
|
|
" <td>8.3</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>209786</th>\n",
|
|
|
|
" <td>84M478</td>\n",
|
|
|
|
" <td>Inwood Academy for Leadership Charter School</td>\n",
|
|
|
|
" <td>Secondary School</td>\n",
|
|
|
|
" <td>NaN</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>78</td>\n",
|
|
|
|
" <td>55.1</td>\n",
|
|
|
|
" <td>52</td>\n",
|
|
|
|
" <td>66.7</td>\n",
|
|
|
|
" <td>26</td>\n",
|
|
|
|
" <td>33.3</td>\n",
|
|
|
|
" <td>5</td>\n",
|
|
|
|
" <td>6.4</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" <td>0</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" </tbody>\n",
|
|
|
|
"</table>\n",
|
|
|
|
"</div>"
|
|
|
|
],
|
|
|
|
"text/plain": [
|
|
|
|
" School DBN School Name \\\n",
|
|
|
|
"18654 84M478 Inwood Academy for Leadership Charter School \n",
|
|
|
|
"52756 84M478 Inwood Academy for Leadership Charter School \n",
|
|
|
|
"52757 84M478 Inwood Academy for Leadership Charter School \n",
|
|
|
|
"100865 84M478 Inwood Academy for Leadership Charter School \n",
|
|
|
|
"100866 84M478 Inwood Academy for Leadership Charter School \n",
|
|
|
|
"100867 84M478 Inwood Academy for Leadership Charter School \n",
|
|
|
|
"138300 84M478 Inwood Academy for Leadership Charter School \n",
|
|
|
|
"138301 84M478 Inwood Academy for Leadership Charter School \n",
|
|
|
|
"209785 84M478 Inwood Academy for Leadership Charter School \n",
|
|
|
|
"209786 84M478 Inwood Academy for Leadership Charter School \n",
|
|
|
|
"\n",
|
|
|
|
" School Level Regents Exam Year Total Tested Mean Score \\\n",
|
|
|
|
"18654 Secondary School NaN 2015 90 55.6 \n",
|
|
|
|
"52756 Secondary School NaN 2015 81 55.9 \n",
|
|
|
|
"52757 Secondary School NaN 2015 9 53.4 \n",
|
|
|
|
"100865 Secondary School NaN 2015 5 s \n",
|
|
|
|
"100866 Secondary School NaN 2015 54 57.4 \n",
|
|
|
|
"100867 Secondary School NaN 2015 31 s \n",
|
|
|
|
"138300 Secondary School NaN 2015 54 57.3 \n",
|
|
|
|
"138301 Secondary School NaN 2015 36 53.2 \n",
|
|
|
|
"209785 Secondary School NaN 2015 12 59 \n",
|
|
|
|
"209786 Secondary School NaN 2015 78 55.1 \n",
|
|
|
|
"\n",
|
|
|
|
" Number Scoring Below 65 Percent Scoring Below 65 \\\n",
|
|
|
|
"18654 61 67.8 \n",
|
|
|
|
"52756 55 67.9 \n",
|
|
|
|
"52757 6 66.7 \n",
|
|
|
|
"100865 s s \n",
|
|
|
|
"100866 34 63 \n",
|
|
|
|
"100867 s s \n",
|
|
|
|
"138300 34 63 \n",
|
|
|
|
"138301 27 75 \n",
|
|
|
|
"209785 9 75 \n",
|
|
|
|
"209786 52 66.7 \n",
|
|
|
|
"\n",
|
|
|
|
" Number Scoring 65 or Above Percent Scoring 65 or Above \\\n",
|
|
|
|
"18654 29 32.2 \n",
|
|
|
|
"52756 26 32.1 \n",
|
|
|
|
"52757 3 33.3 \n",
|
|
|
|
"100865 s s \n",
|
|
|
|
"100866 20 37 \n",
|
|
|
|
"100867 s s \n",
|
|
|
|
"138300 20 37 \n",
|
|
|
|
"138301 9 25 \n",
|
|
|
|
"209785 3 25 \n",
|
|
|
|
"209786 26 33.3 \n",
|
|
|
|
"\n",
|
|
|
|
" Number Scoring 80 or Above Percent Scoring 80 or Above \\\n",
|
|
|
|
"18654 6 6.7 \n",
|
|
|
|
"52756 5 6.2 \n",
|
|
|
|
"52757 1 11.1 \n",
|
|
|
|
"100865 s s \n",
|
|
|
|
"100866 6 11.1 \n",
|
|
|
|
"100867 s s \n",
|
|
|
|
"138300 5 9.3 \n",
|
|
|
|
"138301 1 2.8 \n",
|
|
|
|
"209785 1 8.3 \n",
|
|
|
|
"209786 5 6.4 \n",
|
|
|
|
"\n",
|
|
|
|
" Number Scoring CR Percent Scoring CR \n",
|
|
|
|
"18654 0 0 \n",
|
|
|
|
"52756 0 0 \n",
|
|
|
|
"52757 0 0 \n",
|
|
|
|
"100865 na na \n",
|
|
|
|
"100866 0 0 \n",
|
|
|
|
"100867 na na \n",
|
|
|
|
"138300 0 0 \n",
|
|
|
|
"138301 0 0 \n",
|
|
|
|
"209785 0 0 \n",
|
|
|
|
"209786 0 0 "
|
|
|
|
]
|
|
|
|
},
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 8,
|
2022-07-11 21:42:36 -04:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"df[df['Regents Exam'].isna()]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 9,
|
2022-07-11 21:42:36 -04:00
|
|
|
"id": "c9a49215",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# Cleaning the data\n",
|
|
|
|
"\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"# There are ten missing values in the 'Regents Exam' column. One school is responsible.\n",
|
|
|
|
"# We'll drop that school from the dataset\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
"\n",
|
|
|
|
"df.dropna(inplace = True)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 10,
|
2022-07-15 16:22:57 -04:00
|
|
|
"id": "738ee993",
|
2022-07-11 21:42:36 -04:00
|
|
|
"metadata": {},
|
2022-07-15 16:22:57 -04:00
|
|
|
"outputs": [],
|
2022-07-11 21:42:36 -04:00
|
|
|
"source": [
|
2022-07-15 16:22:57 -04:00
|
|
|
"# We're interested in two score columns. We'll drop the other columns.\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
"\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"drop_cols = ['Number Scoring Below 65', 'Percent Scoring Below 65', 'Number Scoring 65 or Above', 'Percent Scoring 65 or Above', 'Number Scoring 80 or Above', 'Number Scoring CR', 'Percent Scoring CR']\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
"\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"df.drop(drop_cols, axis = 1, inplace = True)"
|
2022-07-11 21:42:36 -04:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 11,
|
2022-07-15 16:22:57 -04:00
|
|
|
"id": "258073d0",
|
2022-07-11 21:42:36 -04:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2022-07-15 16:22:57 -04:00
|
|
|
"text/html": [
|
|
|
|
"<div>\n",
|
|
|
|
"<style scoped>\n",
|
|
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
|
|
" vertical-align: middle;\n",
|
|
|
|
" }\n",
|
|
|
|
"\n",
|
|
|
|
" .dataframe tbody tr th {\n",
|
|
|
|
" vertical-align: top;\n",
|
|
|
|
" }\n",
|
|
|
|
"\n",
|
|
|
|
" .dataframe thead th {\n",
|
|
|
|
" text-align: right;\n",
|
|
|
|
" }\n",
|
|
|
|
"</style>\n",
|
|
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
|
|
" <thead>\n",
|
|
|
|
" <tr style=\"text-align: right;\">\n",
|
|
|
|
" <th></th>\n",
|
|
|
|
" <th>School DBN</th>\n",
|
|
|
|
" <th>School Name</th>\n",
|
|
|
|
" <th>School Level</th>\n",
|
|
|
|
" <th>Regents Exam</th>\n",
|
|
|
|
" <th>Year</th>\n",
|
|
|
|
" <th>Total Tested</th>\n",
|
|
|
|
" <th>Mean Score</th>\n",
|
|
|
|
" <th>Percent Scoring 80 or Above</th>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" </thead>\n",
|
|
|
|
" <tbody>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>0</th>\n",
|
|
|
|
" <td>01M034</td>\n",
|
|
|
|
" <td>P.S. 034 Franklin D. Roosevelt</td>\n",
|
|
|
|
" <td>K-8</td>\n",
|
|
|
|
" <td>Common Core Algebra</td>\n",
|
|
|
|
" <td>2017</td>\n",
|
|
|
|
" <td>4</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>1</th>\n",
|
|
|
|
" <td>01M034</td>\n",
|
|
|
|
" <td>P.S. 034 Franklin D. Roosevelt</td>\n",
|
|
|
|
" <td>K-8</td>\n",
|
|
|
|
" <td>Living Environment</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>16</td>\n",
|
|
|
|
" <td>77.9</td>\n",
|
|
|
|
" <td>43.8</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>2</th>\n",
|
|
|
|
" <td>01M034</td>\n",
|
|
|
|
" <td>P.S. 034 Franklin D. Roosevelt</td>\n",
|
|
|
|
" <td>K-8</td>\n",
|
|
|
|
" <td>Living Environment</td>\n",
|
|
|
|
" <td>2016</td>\n",
|
|
|
|
" <td>9</td>\n",
|
|
|
|
" <td>74</td>\n",
|
|
|
|
" <td>22.2</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>3</th>\n",
|
|
|
|
" <td>01M140</td>\n",
|
|
|
|
" <td>P.S. 140 Nathan Straus</td>\n",
|
|
|
|
" <td>K-8</td>\n",
|
|
|
|
" <td>Common Core Algebra</td>\n",
|
|
|
|
" <td>2016</td>\n",
|
|
|
|
" <td>3</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>4</th>\n",
|
|
|
|
" <td>01M140</td>\n",
|
|
|
|
" <td>P.S. 140 Nathan Straus</td>\n",
|
|
|
|
" <td>K-8</td>\n",
|
|
|
|
" <td>Common Core Algebra</td>\n",
|
|
|
|
" <td>2017</td>\n",
|
|
|
|
" <td>2</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" <td>s</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" </tbody>\n",
|
|
|
|
"</table>\n",
|
|
|
|
"</div>"
|
|
|
|
],
|
2022-07-11 21:42:36 -04:00
|
|
|
"text/plain": [
|
2022-07-15 16:22:57 -04:00
|
|
|
" School DBN School Name School Level \\\n",
|
|
|
|
"0 01M034 P.S. 034 Franklin D. Roosevelt K-8 \n",
|
|
|
|
"1 01M034 P.S. 034 Franklin D. Roosevelt K-8 \n",
|
|
|
|
"2 01M034 P.S. 034 Franklin D. Roosevelt K-8 \n",
|
|
|
|
"3 01M140 P.S. 140 Nathan Straus K-8 \n",
|
|
|
|
"4 01M140 P.S. 140 Nathan Straus K-8 \n",
|
|
|
|
"\n",
|
|
|
|
" Regents Exam Year Total Tested Mean Score \\\n",
|
|
|
|
"0 Common Core Algebra 2017 4 s \n",
|
|
|
|
"1 Living Environment 2015 16 77.9 \n",
|
|
|
|
"2 Living Environment 2016 9 74 \n",
|
|
|
|
"3 Common Core Algebra 2016 3 s \n",
|
|
|
|
"4 Common Core Algebra 2017 2 s \n",
|
|
|
|
"\n",
|
|
|
|
" Percent Scoring 80 or Above \n",
|
|
|
|
"0 s \n",
|
|
|
|
"1 43.8 \n",
|
|
|
|
"2 22.2 \n",
|
|
|
|
"3 s \n",
|
|
|
|
"4 s "
|
2022-07-11 21:42:36 -04:00
|
|
|
]
|
|
|
|
},
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 11,
|
2022-07-11 21:42:36 -04:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2022-07-15 16:22:57 -04:00
|
|
|
"df.head()"
|
2022-07-11 21:42:36 -04:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 12,
|
2022-07-15 16:22:57 -04:00
|
|
|
"id": "1f05cd97",
|
2022-07-11 21:42:36 -04:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
2022-07-15 16:22:57 -04:00
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"<class 'pandas.core.frame.DataFrame'>\n",
|
|
|
|
"Int64Index: 137101 entries, 1 to 212325\n",
|
|
|
|
"Data columns (total 8 columns):\n",
|
|
|
|
" # Column Non-Null Count Dtype \n",
|
|
|
|
"--- ------ -------------- ----- \n",
|
|
|
|
" 0 School DBN 137101 non-null object \n",
|
|
|
|
" 1 School Name 137101 non-null object \n",
|
|
|
|
" 2 School Level 137101 non-null object \n",
|
|
|
|
" 3 Regents Exam 137101 non-null object \n",
|
|
|
|
" 4 Year 137101 non-null int64 \n",
|
|
|
|
" 5 Total Tested 137101 non-null int64 \n",
|
|
|
|
" 6 Mean Score 137101 non-null float64\n",
|
|
|
|
" 7 Percent Scoring 80 or Above 137101 non-null float64\n",
|
|
|
|
"dtypes: float64(2), int64(2), object(4)\n",
|
|
|
|
"memory usage: 9.4+ MB\n"
|
|
|
|
]
|
2022-07-11 21:42:36 -04:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2022-07-15 16:22:57 -04:00
|
|
|
"# 'Mean Score' and 'Percent Scoring 80 or Above'\n",
|
|
|
|
"\n",
|
|
|
|
"# We expect integers or floats. Instead we have objects.\n",
|
|
|
|
"# Can we convert them to floats?\n",
|
|
|
|
"\n",
|
|
|
|
"# Yes, but first we have to deal with the non-numeric value 's'.\n",
|
|
|
|
"# We don't know what 's' means so let's make a subset\n",
|
|
|
|
"# then convert the scores to floats.\n",
|
|
|
|
"\n",
|
|
|
|
"df = df[df['Mean Score'] != 's']\n",
|
|
|
|
"df['Mean Score'] = pd.to_numeric(df['Mean Score'])\n",
|
|
|
|
"df = df[df['Percent Scoring 80 or Above'] != 's']\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
"df['Percent Scoring 80 or Above'] = pd.to_numeric(df['Percent Scoring 80 or Above'])\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"df.info()"
|
2022-07-11 21:42:36 -04:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 13,
|
2022-07-15 16:22:57 -04:00
|
|
|
"id": "f86ea927",
|
2022-07-11 21:42:36 -04:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/html": [
|
|
|
|
"<div>\n",
|
|
|
|
"<style scoped>\n",
|
|
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
|
|
" vertical-align: middle;\n",
|
|
|
|
" }\n",
|
|
|
|
"\n",
|
|
|
|
" .dataframe tbody tr th {\n",
|
|
|
|
" vertical-align: top;\n",
|
|
|
|
" }\n",
|
|
|
|
"\n",
|
|
|
|
" .dataframe thead th {\n",
|
|
|
|
" text-align: right;\n",
|
|
|
|
" }\n",
|
|
|
|
"</style>\n",
|
|
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
|
|
" <thead>\n",
|
|
|
|
" <tr style=\"text-align: right;\">\n",
|
|
|
|
" <th></th>\n",
|
|
|
|
" <th>School DBN</th>\n",
|
|
|
|
" <th>School Name</th>\n",
|
|
|
|
" <th>School Level</th>\n",
|
|
|
|
" <th>Regents Exam</th>\n",
|
|
|
|
" <th>Year</th>\n",
|
|
|
|
" <th>Total Tested</th>\n",
|
|
|
|
" <th>Mean Score</th>\n",
|
|
|
|
" <th>Percent Scoring 80 or Above</th>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" </thead>\n",
|
|
|
|
" <tbody>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>148870</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>English</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>33</td>\n",
|
|
|
|
" <td>74.8</td>\n",
|
|
|
|
" <td>24.2</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>2224</th>\n",
|
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>English</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" <td>2015</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>65</td>\n",
|
|
|
|
" <td>74.1</td>\n",
|
|
|
|
" <td>30.8</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>107118</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>English</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>31</td>\n",
|
|
|
|
" <td>71.8</td>\n",
|
|
|
|
" <td>25.8</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>107117</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>English</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>34</td>\n",
|
|
|
|
" <td>76.3</td>\n",
|
|
|
|
" <td>35.3</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>148869</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>English</td>\n",
|
|
|
|
" <td>2015</td>\n",
|
|
|
|
" <td>25</td>\n",
|
|
|
|
" <td>75.3</td>\n",
|
|
|
|
" <td>40.0</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>59860</th>\n",
|
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>English</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" <td>2015</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>49</td>\n",
|
|
|
|
" <td>73.3</td>\n",
|
|
|
|
" <td>26.5</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>148861</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
|
|
|
" <td>2016</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>22</td>\n",
|
|
|
|
" <td>75.4</td>\n",
|
|
|
|
" <td>36.4</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>148860</th>\n",
|
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
|
|
|
" <td>2016</td>\n",
|
|
|
|
" <td>10</td>\n",
|
|
|
|
" <td>70.0</td>\n",
|
|
|
|
" <td>30.0</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>107114</th>\n",
|
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" <td>2016</td>\n",
|
|
|
|
" <td>15</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>68.8</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" <td>13.3</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>2222</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>2016</td>\n",
|
|
|
|
" <td>38</td>\n",
|
|
|
|
" <td>74.2</td>\n",
|
|
|
|
" <td>36.8</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>59854</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>2016</td>\n",
|
|
|
|
" <td>22</td>\n",
|
|
|
|
" <td>76.8</td>\n",
|
|
|
|
" <td>45.5</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>23480</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>Common Core English</td>\n",
|
|
|
|
" <td>2016</td>\n",
|
|
|
|
" <td>8</td>\n",
|
|
|
|
" <td>71.9</td>\n",
|
|
|
|
" <td>25.0</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>23479</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>Common Core English</td>\n",
|
|
|
|
" <td>2016</td>\n",
|
|
|
|
" <td>30</td>\n",
|
|
|
|
" <td>74.9</td>\n",
|
|
|
|
" <td>40.0</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>107113</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" <td>2016</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>23</td>\n",
|
|
|
|
" <td>77.8</td>\n",
|
|
|
|
" <td>52.2</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>59857</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>2017</td>\n",
|
|
|
|
" <td>45</td>\n",
|
|
|
|
" <td>77.5</td>\n",
|
|
|
|
" <td>55.6</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>107116</th>\n",
|
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
|
|
|
" <td>2017</td>\n",
|
|
|
|
" <td>27</td>\n",
|
|
|
|
" <td>78.9</td>\n",
|
|
|
|
" <td>66.7</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>2223</th>\n",
|
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
|
|
|
" <td>2017</td>\n",
|
|
|
|
" <td>63</td>\n",
|
|
|
|
" <td>77.8</td>\n",
|
|
|
|
" <td>54.0</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>148864</th>\n",
|
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" <td>2017</td>\n",
|
|
|
|
" <td>6</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>76.7</td>\n",
|
|
|
|
" <td>50.0</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <th>148865</th>\n",
|
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" <td>2017</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>16</td>\n",
|
|
|
|
" <td>78.6</td>\n",
|
|
|
|
" <td>50.0</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <th>148866</th>\n",
|
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
|
|
|
" <td>2017</td>\n",
|
|
|
|
" <td>34</td>\n",
|
|
|
|
" <td>76.9</td>\n",
|
|
|
|
" <td>52.9</td>\n",
|
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
|
|
|
" <th>148867</th>\n",
|
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
|
|
|
" <td>Common Core English</td>\n",
|
|
|
|
" <td>2017</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" <td>7</td>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>81.1</td>\n",
|
|
|
|
" <td>71.4</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" <tr>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <th>107115</th>\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" <td>02M605</td>\n",
|
|
|
|
" <td>Humanities Preparatory Academy</td>\n",
|
|
|
|
" <td>High school</td>\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
" <td>Common Core English</td>\n",
|
|
|
|
" <td>2017</td>\n",
|
|
|
|
" <td>36</td>\n",
|
|
|
|
" <td>77.0</td>\n",
|
|
|
|
" <td>44.4</td>\n",
|
2022-07-11 21:42:36 -04:00
|
|
|
" </tr>\n",
|
|
|
|
" </tbody>\n",
|
|
|
|
"</table>\n",
|
|
|
|
"</div>"
|
|
|
|
],
|
|
|
|
"text/plain": [
|
|
|
|
" School DBN School Name School Level \\\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"148870 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"2224 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"107118 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"107117 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"148869 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"59860 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"148861 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"148860 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"107114 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"2222 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"59854 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"23480 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"23479 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"107113 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"59857 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"107116 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"2223 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"148864 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"148865 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"148866 02M605 Humanities Preparatory Academy High school \n",
|
|
|
|
"148867 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"107115 02M605 Humanities Preparatory Academy High school \n",
|
2022-07-11 21:42:36 -04:00
|
|
|
"\n",
|
|
|
|
" Regents Exam Year Total Tested Mean Score \\\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"148870 English 2015 33 74.8 \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"2224 English 2015 65 74.1 \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"107118 English 2015 31 71.8 \n",
|
|
|
|
"107117 English 2015 34 76.3 \n",
|
|
|
|
"148869 English 2015 25 75.3 \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"59860 English 2015 49 73.3 \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"148861 Common Core English 2016 22 75.4 \n",
|
|
|
|
"148860 Common Core English 2016 10 70.0 \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"107114 Common Core English 2016 15 68.8 \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"2222 Common Core English 2016 38 74.2 \n",
|
|
|
|
"59854 Common Core English 2016 22 76.8 \n",
|
|
|
|
"23480 Common Core English 2016 8 71.9 \n",
|
|
|
|
"23479 Common Core English 2016 30 74.9 \n",
|
|
|
|
"107113 Common Core English 2016 23 77.8 \n",
|
|
|
|
"59857 Common Core English 2017 45 77.5 \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"107116 Common Core English 2017 27 78.9 \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"2223 Common Core English 2017 63 77.8 \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"148864 Common Core English 2017 6 76.7 \n",
|
|
|
|
"148865 Common Core English 2017 16 78.6 \n",
|
|
|
|
"148866 Common Core English 2017 34 76.9 \n",
|
|
|
|
"148867 Common Core English 2017 7 81.1 \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"107115 Common Core English 2017 36 77.0 \n",
|
2022-07-11 21:42:36 -04:00
|
|
|
"\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
" Percent Scoring 80 or Above \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"148870 24.2 \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"2224 30.8 \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"107118 25.8 \n",
|
|
|
|
"107117 35.3 \n",
|
|
|
|
"148869 40.0 \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"59860 26.5 \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"148861 36.4 \n",
|
|
|
|
"148860 30.0 \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"107114 13.3 \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"2222 36.8 \n",
|
|
|
|
"59854 45.5 \n",
|
|
|
|
"23480 25.0 \n",
|
|
|
|
"23479 40.0 \n",
|
|
|
|
"107113 52.2 \n",
|
|
|
|
"59857 55.6 \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"107116 66.7 \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"2223 54.0 \n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"148864 50.0 \n",
|
|
|
|
"148865 50.0 \n",
|
|
|
|
"148866 52.9 \n",
|
|
|
|
"148867 71.4 \n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"107115 44.4 "
|
2022-07-15 16:22:57 -04:00
|
|
|
]
|
|
|
|
},
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 13,
|
2022-07-15 16:22:57 -04:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# Filter the dataset. Let's have a look at the Humanities Preparatory Academy High School in Chelsea\n",
|
|
|
|
"\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"df[df['School DBN'] == '02M605'].sort_values(by = ['Year'])"
|
2022-07-15 16:22:57 -04:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 14,
|
2022-07-15 16:22:57 -04:00
|
|
|
"id": "1cc0ab0a",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"Year\n",
|
|
|
|
"2015 74.266667\n",
|
|
|
|
"2016 73.725000\n",
|
|
|
|
"2017 78.062500\n",
|
|
|
|
"Name: Mean Score, dtype: float64"
|
|
|
|
]
|
|
|
|
},
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 14,
|
2022-07-15 16:22:57 -04:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# How did this school perform over three years?\n",
|
|
|
|
"\n",
|
|
|
|
"df[df['School DBN'] == '02M605'].groupby(['Year'])['Mean Score'].mean()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 15,
|
2022-07-15 16:22:57 -04:00
|
|
|
"id": "8ad44a32",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"Year\n",
|
|
|
|
"2015 70.562738\n",
|
|
|
|
"2016 70.612695\n",
|
|
|
|
"2017 72.814383\n",
|
|
|
|
"Name: Mean Score, dtype: float64"
|
|
|
|
]
|
|
|
|
},
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 15,
|
2022-07-15 16:22:57 -04:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# Other high schools in Manhattan\n",
|
|
|
|
"\n",
|
|
|
|
"df[(df['School DBN'] != '02M605')\n",
|
|
|
|
" & (df['School Level'] == 'High school')\n",
|
|
|
|
" & (df['School DBN'].str.contains('M'))\n",
|
|
|
|
" & (df['Regents Exam']).str.contains('English')\n",
|
|
|
|
" ].groupby(['Year'])['Mean Score'].mean()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 16,
|
2022-07-15 16:22:57 -04:00
|
|
|
"id": "3b420509",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"Year\n",
|
|
|
|
"2015 67.399191\n",
|
|
|
|
"2016 65.028724\n",
|
|
|
|
"2017 67.557191\n",
|
|
|
|
"Name: Mean Score, dtype: float64"
|
|
|
|
]
|
|
|
|
},
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 16,
|
2022-07-15 16:22:57 -04:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2022-07-15 21:14:21 -04:00
|
|
|
"# Other high schools in other boroughs\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"\n",
|
|
|
|
"df[(df['School DBN'] != '02M605')\n",
|
|
|
|
" & (df['School Level'] == 'High school')\n",
|
|
|
|
" & (~df['School DBN'].str.contains('M'))\n",
|
|
|
|
" & (df['Regents Exam']).str.contains('English')\n",
|
|
|
|
" ].groupby(['Year'])['Mean Score'].mean()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 17,
|
2022-07-15 21:14:21 -04:00
|
|
|
"id": "e0e8e522",
|
2022-07-15 16:22:57 -04:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
2022-07-15 21:14:21 -04:00
|
|
|
"<AxesSubplot:>"
|
2022-07-11 21:42:36 -04:00
|
|
|
]
|
|
|
|
},
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 17,
|
2022-07-11 21:42:36 -04:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
2022-07-15 16:22:57 -04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
2022-07-15 21:14:21 -04:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlAAAAE+CAYAAABC9C7yAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAoq0lEQVR4nO3deZyXZb3/8deHARlUNEDwKESIoYDMMOCwKIooii2EaKC5grikHgtPRqGmkqU/SovSk3XMhanU45YHxY6KBiLlhooKgpKdERDCcQEBJWG4fn/MlwlkmxtmmGHm9Xw8eNzf+7q3z3e4gDfXvUVKCUmSJFVdo9ouQJIkaVdjgJIkScrIACVJkpSRAUqSJCkjA5QkSVJGBihJkqSMGu/Mg+2zzz6pQ4cOO/OQkiRJ2+XFF198L6XUenPLdmqA6tChAzNnztyZh5QkSdouEfH2lpZ5Ck+SJCmjKgWoiPiPiJgTEbMj4u6IyI+IlhExJSLm56YtarpYSZKkumCbASoi2gLfBopTSt2APOAbwFjgyZRSJ+DJ3LwkSVK9V9VroBoDzSJiDbA7sBi4DBiQW14CTAO+X831SbusNWvWsGjRIlavXl3bpUjVIj8/n3bt2tGkSZPaLkWqddsMUCmldyLiBmAB8AnweErp8YjYN6W0JLfOkohos7ntI+J84HyA9u3bV1/lUh23aNEimjdvTocOHYiI2i5H2iEpJd5//30WLVrEAQccUNvlSLWuKqfwWgAnAAcA+wN7RMQZVT1ASumWlFJxSqm4devN3gko1UurV6+mVatWhifVCxFBq1atHFGVcqpyEfmxwP+llMpSSmuAPwKHA0sjYj+A3PTdmitT2jUZnlSf2J+lf6lKgFoA9I2I3aPiT89AYC7wEDAit84IYFLNlChpe+25554bzU+cOJGLL764lqqBww8/HIDS0lLuuuuuyvaZM2fy7W9/e4f336FDBwoKCujevTuDBg3iH//4xw7vU5I2pyrXQD0XEfcDLwFrgZeBW4A9gXsj4hwqQtbwmixU2tV1GPtIte6vdPxXq3V/O8Nf//pX4F8B6rTTTgOguLiY4uLiajnG1KlT2Weffbj88su57rrruPHGGyuXpZRIKdGokY/Ak7RjqvS3SErp6pRS55RSt5TSmSmlf6aU3k8pDUwpdcpNP6jpYiVVn5EjR3L//fdXzq8frZo2bRpHHXUUJ598MgcddBBjx47lzjvvpHfv3hQUFPDWW28B8PDDD9OnTx969OjBsccey9KlSwEYN24co0aNYsCAAXTs2HGjALP+GGPHjuXpp5+mqKiICRMmMG3aNAYPHgzAqlWrGDVqFL169aJHjx5MmlQxuD1nzhx69+5NUVERhYWFzJ8/f6vfr3///vztb3+jtLSULl26cNFFF9GzZ08WLlzI9ddfT69evSgsLOTqq68GKkJd586dGTFiBIWFhQwbNoyPP/64On7UkuqhnfoqF0k71yeffEJRUVHl/AcffMCQIUO2ud0rr7zC3LlzadmyJR07duTcc8/l+eef55e//CU33XQTv/jFLzjiiCN49tlniQhuvfVWfvrTn/Kzn/0MgHnz5jF16lRWrFjBwQcfzIUXXrjRre/jx4/nhhtuYPLkyUBFaFvv2muv5ZhjjuH2229n2bJl9O7dm2OPPZbf/OY3jB49mtNPP51PP/2U8vLyrX6HyZMnU1BQAMAbb7zBHXfcwc0338zjjz/O/Pnzef7550kpMWTIEKZPn0779u154403uO222+jXrx+jRo3i5ptv5rvf/W5Vf9zaBVT3SHAWu+KosbbMACXVY82aNWPWrFmV8xMnTqzS+yh79erFfvvtB8CBBx7IoEGDACgoKGDq1KlAxWMaTjnlFJYsWcKnn3660a3tX/3qV2natClNmzalTZs2LF26lHbt2lWp5scff5yHHnqIG264Aai4m3HBggUcdthhXHvttSxatIiTTjqJTp06bXb7o48+mry8PAoLC/nxj3/MsmXL+MIXvkDfvn0r9//444/To0cPAFauXMn8+fNp3749n//85+nXrx8AZ5xxBjfeeKMBStJmGaCkBqpx48asW7cOqLg26NNPP61c1rRp08rPjRo1qpxv1KgRa9euBeBb3/oW3/nOdxgyZAjTpk1j3Lhxm90+Ly+vcpuqSCnxwAMPcPDBB2/U3qVLF/r06cMjjzzC8ccfz6233soxxxyzyfbrr4Fab9myZeyxxx4b7f+yyy7jm9/85kbblZaWbnKXmXedSdoSr6SUGqgOHTrw4osvAjBp0iTWrFmTafvly5fTtm1bAEpKSjJt27x5c1asWLHZZccffzw33XQTKSUAXn75ZQD+/ve/07FjR7797W8zZMgQXn311UzH3HD/t99+OytXrgTgnXfe4d13K57CsmDBAp555hkA7r77bo444ojtOoak+s8AJTVQ5513Hk899RS9e/fmueee22iUpirGjRvH8OHDOfLIIzca8amKwsJCGjduTPfu3ZkwYcJGy6688krWrFlDYWEh3bp148orrwTgnnvuoVu3bhQVFTFv3jzOOuusTMdcb9CgQZx22mkcdthhFBQUMGzYsMow16VLF0pKSigsLOSDDz7gwgsv3K5jSKr/Yv3/8naG4uLiVJXrL6T6YO7cuXTp0qW2y1AVlZaWMnjwYGbPnl3bpdRpu3q/9iJyZRERL6aUNvuMFUegJEmSMjJASRIV14Q5+iSpqgxQkiRJGRmgJEmSMjJASZIkZWSAkiRJysgAJdVjixYt4oQTTqBTp04ceOCBjB49uvKJ47NmzeJPf/pT5brjxo2rfH1KdRg5ciS77777Rg/MHD16NBHBe++9t9373PAFyNuybNkybr755sr50tJS7rrrru06dlXrWf/C5MWLFzNs2LBt7mP9+pJ2Lb7KpQp8boiqxbi9q3l/y7e6OKXESSedxIUXXsikSZMoLy/n/PPP54orruD6669n1qxZzJw5k6985SvVUk55eTl5eXkbtX3xi19k0qRJnHHGGaxbt46pU6dWPr18Z1gfoC666CLgXwHqtNNOq/Fj77///pnCnqRdiyNQUj315z//mfz8fM4++2yg4p10EyZM4Pbbb+ejjz7iqquu4p577qGoqIh77rkHgNdff50BAwbQsWNHbrzxxsp9/eEPf6B3794UFRXxzW9+k/LycqBi9OSqq66iT58+la9A2dCpp55aue9p06bRr18/Gjf+1//bhg4dyqGHHsohhxzCLbfcUtm+5557csUVV9C9e3f69u3L0qVLK5dNnz6dww8/nI4dO1YGlJUrVzJw4EB69uxJQUEBkyZNAmDs2LG89dZbFBUVMWbMGMaOHcvTTz9NUVEREyZMoLS0lCOPPJKePXvSs2dP/vrXv1bWOmDAAIYNG0bnzp05/fTTyfrQ4dLSUrp16wbAxx9/zMknn0xhYSGnnHIKffr02eilzpv7rvfddx/dunWje/fu9O/fP9OxJdU8R6CkemrOnDkceuihG7XttddetG/fntLSUq655hpmzpzJf/7nfwJw4XfG8tKrs7n1nodZtWolJxzVi35fO5WFpX/ntyV/4Nf3PEKTJk249vJLGX/Tb/nasG+watUqmu93AL994DEAXl20rPJYH676lN1a7s/b7/yDGbNL+dWtJXz1xJN5aPIjzFm8nBarG3Ppjyawd4sWdGrVlF69evH1r3+dVq1asWrVKvr27cu1117L9773PX7729/ygx/8AIAlS5YwY8YM5s2bx5AhQxg2bBj5+fk8+OCD7LXXXrz33nv07duXIUOGMH78eGbPns2sWbOAimB0ww03MHnyZKAi2EyZMoX8/Hzmz5/PqaeeWhlsXn75ZebMmcP+++9Pv379+Mtf/rLZd+ONGTOGH//4x1v9vbj55ptp0aIFr776KrNnz6aoqKhy2Za+6zXXXMNjjz1G27ZtWbZs2Rb3Lal2GKCkeiqlRERUuR3gyGMGsVvTpuzWtCkt92nNB++9y3N/eYq5r77C6YOPAWD16tW03Kc1UDGqdexXhmy1joFfHsyjDz3Aay/P5MrxG7/37q47/os/PzqZ/CZ5LFy
|
2022-07-15 16:22:57 -04:00
|
|
|
"text/plain": [
|
2022-07-15 21:14:21 -04:00
|
|
|
"<Figure size 720x360 with 1 Axes>"
|
2022-07-15 16:22:57 -04:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {
|
|
|
|
"needs_background": "light"
|
|
|
|
},
|
|
|
|
"output_type": "display_data"
|
2022-07-11 21:42:36 -04:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2022-07-15 21:14:21 -04:00
|
|
|
"# Visualization\n",
|
2022-07-15 16:22:57 -04:00
|
|
|
"\n",
|
2022-07-15 21:14:21 -04:00
|
|
|
"# Dictionary made by manually entering data from three previous cells.\n",
|
|
|
|
"# I wish I knew how to do this programmatically.\n",
|
|
|
|
"\n",
|
|
|
|
"d = {'Humanities Prep': [74.266667, 73.725000, 78.062500],\n",
|
|
|
|
" 'Other Manhattan Highs': [70.562738, 70.612695, 72.814383],\n",
|
|
|
|
" 'High Schools Other Boroughs': [67.399191, 65.028724, 67.557191]}\n",
|
|
|
|
"new_df = pd.DataFrame(data = d, index = ['2015', '2016', '2017'])\n",
|
|
|
|
"new_df.plot(kind = 'bar', figsize = (10, 5))"
|
2022-07-11 21:42:36 -04:00
|
|
|
]
|
2022-07-15 16:22:57 -04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2022-07-18 15:48:53 -04:00
|
|
|
"execution_count": 29,
|
|
|
|
"id": "207154ad",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# a more elegant way to create the dictionary\n",
|
|
|
|
"\n",
|
|
|
|
"test0 = df[df['School DBN'] == '02M605'].groupby(['Year'])['Mean Score'].mean()\n",
|
|
|
|
"test1 = df[(df['School DBN'] != '02M605')\n",
|
|
|
|
" & (df['School Level'] == 'High school')\n",
|
|
|
|
" & (df['School DBN'].str.contains('M'))\n",
|
|
|
|
" & (df['Regents Exam']).str.contains('English')\n",
|
|
|
|
" ].groupby(['Year'])['Mean Score'].mean()\n",
|
|
|
|
"test2 = df[(df['School DBN'] != '02M605')\n",
|
|
|
|
" & (df['School Level'] == 'High school')\n",
|
|
|
|
" & (~df['School DBN'].str.contains('M'))\n",
|
|
|
|
" & (df['Regents Exam']).str.contains('English')\n",
|
|
|
|
" ].groupby(['Year'])['Mean Score'].mean()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 31,
|
|
|
|
"id": "19a88bc3",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# 3 dictionaries to 3 dataframes\n",
|
|
|
|
"\n",
|
|
|
|
"dict0 = pd.DataFrame.from_dict(test0)\n",
|
|
|
|
"dict1 = pd.DataFrame.from_dict(test1)\n",
|
|
|
|
"dict2 = pd.DataFrame.from_dict(test2)\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 51,
|
|
|
|
"id": "7349a50d",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# join dataframes dict0 and dict1\n",
|
|
|
|
"\n",
|
|
|
|
"temp = dict0.join(dict1, lsuffix='_Humanities_Prep', rsuffix='_Other_Manhattan_Highs')\n",
|
|
|
|
"\n",
|
|
|
|
"# join temp and dict2\n",
|
|
|
|
"\n",
|
|
|
|
"newest_df = temp.join(dict2)\n",
|
|
|
|
"\n",
|
|
|
|
"# rename last column\n",
|
|
|
|
"\n",
|
|
|
|
"newest_df = newest_df.rename(columns = {'Mean Score': 'High Schools Other Boroughs'})"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 53,
|
|
|
|
"id": "6d645276",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"<AxesSubplot:xlabel='Year'>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 53,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlAAAAFMCAYAAAAEHoI4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAx0ElEQVR4nO3dd3hUZfrG8fthQLp0EEEJIgIxwYChCSJFiq4FVESkRJGiogK7oqiLxM4Ku7rY2dWlCCGIBRZ2lSIxorQAoSNYQhF+EhFQEJAk7++PDLPBBJIDEzIk38915ZqZU5+ZOSE37znnfc05JwAAAORdsYIuAAAA4FxDgAIAAPCIAAUAAOARAQoAAMAjAhQAAIBHBCgAAACPip/NnVWtWtWFhYWdzV0CAACclpUrV/7onKuW07yzGqDCwsKUlJR0NncJAABwWsxs28nmcQoPAADAozwFKDMbbmYbzGy9mcWZWSkzq2xm881sq/+xUn4XCwAAEApyDVBmVkvSQ5KinXMRknyS7pA0UtJC51x9SQv9rwEAAAq9vF4DVVxSaTM7JqmMpF2SHpPUzj9/kqQESY8GuT7grDp27Jh27typI0eOFHQpQKFWqlQp1a5dWyVKlCjoUoDTkmuAcs59b2bjJG2XdFjSPOfcPDOr4Zzb7V9mt5lVz2l9MxskaZAkXXzxxcGrHMgHO3fuVPny5RUWFiYzK+hygELJOae9e/dq586dqlu3bkGXA5yWvJzCqyTpZkl1JV0oqayZ9cnrDpxzE5xz0c656GrVcrwTEAgZR44cUZUqVQhPQD4yM1WpUoWWXpzT8nIR+bWSvnPOpTrnjkn6QNJVkn4ws5qS5H/ck39lAmcP4QnIf/ye4VyXlwC1XVJLMytjmUd8R0mbJM2WFONfJkbSrPwpEQAAILTk5RqoZWY2U9IqSWmSVkuaIKmcpBlmdo8yQ1aP/CwUKAhhI+cGdXspY/6Q6zJmpj59+mjKlCmSpLS0NNWsWVMtWrTQnDlzglpPVkuXLtXQoUN19OhRHT16VD179lRsbGy+7S8nxzvbrVq1qiQpISFB48aNy9f3fSrXX3+9pk2bJkmaNm2a7r//fknSrl279NBDD2nmzJlB2U9YWJjKly+vYsWKqUaNGpo8ebIuuOCCoGwbQP7IUz9QzrnRzrmGzrkI51xf59xR59xe51xH51x9/+NP+V0sUBSULVtW69ev1+HDhyVJ8+fPV61atfJ9vzExMZowYYKSk5O1fv163X777We8zfT09CBUVnD+85//qGLFitq/f79ef/31wPQLL7wwaOHpuEWLFmnNmjWKjo7W888/f8I855wyMjKCuj8AZ+asDuUCIG+uu+46zZ07V7fddpvi4uLUq1cvff7555KkQ4cO6cEHH9S6deuUlpam2NhY3XzzzUpJSVHfvn116NAhSdKrr76qq666SgkJCYqNjVXVqlW1fv16XXnllXr33XezXYOyZ88e1axZU5Lk8/kUHh4uSTp48KAefPBBJSUlycw0evRo3XrrrYqLi9Pzzz8v55z+8Ic/6C9/+YskqVy5cvrjH/+oTz75RH/961+VkpKi8ePH67ffflOLFi30+uuvy+fzef5MYmNjVa5cOT388MOSpIiIiEDLVNeuXdWmTRstXbpUV1xxhe6++26NHj1ae/bs0dSpU9W8eXMtX75cw4YN0+HDh1W6dGn961//UoMGDTRx4kTNnj1bv/76q7755ht1795dL774oqT/tYiNHDlS33zzjaKiotSpUycNGTJEN9xwg9avX6/09HSNHDlSCQkJOnr0qIYMGaLBgwdr9+7d6tmzp37++WelpaXpjTfe0NVXX53r+2zbtq3Gjx+vlJQUXXfddWrfvr2WLFmijz76SDNmzNCMGTN09OhRde/eXU899ZRSUlLUtWtXtWjRQqtXr9Zll12myZMnq0yZMp4/46Ig2K3KXuSlBRrnDoZyAULQHXfcoenTp+vIkSNau3atWrRoEZj33HPPqUOHDlqxYoUWLVqkESNG6NChQ6pevbrmz5+vVatWKT4+Xg899FBgndWrV+vll1/Wxo0b9e233+qLL77Its/hw4erQYMG6t69u956663AHVLPPPOMKlSooHXr1mnt2rXq0KGDdu3apUcffVSffvqpkpOTtWLFCn300UeSMgNeRESEli1bpipVqig+Pl5ffPGFkpOT5fP5NHXq1FO+9/bt2ysqKkpRUVEaMGBAnj6vr7/+WkOHDtXatWu1efNmTZs2TYsXL9a4ceMCrTkNGzZUYmKiVq9eraefflqPP/54YP3k5GTFx8dr3bp1io+P144dO07Y/pgxY1SvXj0lJydr7NixJ8x7++23VaFCBa1YsUIrVqzQP/7xD3333XeaNm2aunTpouTkZK1Zs0ZRUVF5ei9z5sxRZGSkJOmrr75Sv379tHr1an311VfaunWrli9fruTkZK1cuVKJiYmB5QYNGqS1a9fq/PPPP6G1DED+oAUKCEGNGzdWSkqK4uLidP31158wb968eZo9e7bGjRsnKbPrhe3bt+vCCy/UAw88EAgqW7ZsCazTvHlz1a5dW5IUFRWllJQUtWnT5oTtPvnkk+rdu7fmzZunadOmKS4uTgkJCVqwYIGmT58eWK5SpUpKTExUu3btdLxrkt69eysxMVHdunWTz+fTrbfeKklauHChVq5cqWbNmkmSDh8+rOrVc+wyLmDRokXZroHKTd26dQOh4/LLL1fHjh1lZoqMjFRKSook6cCBA4qJidHWrVtlZjp27Fhg/Y4dO6pChQqSpPDwcG3btk0XXXRRrvuVMr+PtWvXBk7pHThwQFu3blWzZs3Uv39/HTt2TN26dcs1QLVv314+n0+NGzfWs88+q/3796tOnTpq2bJlYD/z5s1TkyZNJGW2DG7dulUXX3yxLrroIrVu3VqS1KdPH40fPz7QUgcgfxCggBB100036eGHH1ZCQoL27t0bmO6c0/vvv68GDRqcsHxsbKxq1KihNWvWKCMjQ6VKlQrMK1myZOC5z+dTWlpajvusV6+e7rvvPg0cOFDVqlXT3r175ZzLdrrPOXfSukuVKhU4ReecU0xMjF544YW8v/GTKF68+AnXAWXtQyjr+ytWrFjgdbFixQLvddSoUWrfvr0+/PBDpaSkqF27djmuf6rPJyfOOb3yyivq0qVLtnmJiYmaO3eu+vbtqxEjRqhfv34n3U7W4ChJ+/fvV9myZU/Yz2OPPabBgwefsF5KSkq274cuAoD8xyk8IET1799fTz75ZKBl5bguXbrolVdeCYSY1atXS8ps+ahZs6aKFSumKVOmeL6Ae+7cuYFtbt26VT6fTxUrVlTnzp316quvBpbbt2+fWrRooc8++0w//vij0tPTFRcXp2uuuSbbNjt27KiZM2dqz57MbuJ++uknbdu2zVNdx4WFhWnVqlWSpFWrVum7777ztP6BAwcCF+NPnDjR07rly5fXL7/8kuO8Ll266I033gi0aG3ZskWHDh3Stm3bVL16dQ0cOFD33HNPoPbT1aVLF73zzjs6ePCgJOn7778PfK7bt2/XkiVLJElxcXHZWhcBBB8tUMApFORFn7Vr19bQoUOzTR81apSGDRumxo0byzmnsLAwzZkzR/fff79uvfVWvffee2rfvv0JrRd5MWXKFA0fPlxlypRR8eLFNXXqVPl8Pv35z3/WkCFDFBERIZ/Pp9GjR+uWW27RCy+8oPbt28s5p+uvv14333xztm2Gh4fr2WefVefOnZWRkaESJUrotddeU506dTx/HrfeeqsmT56sqKgoNWvWTJdddpmn9R955BHFxMTob3/7mzp06OBp3SpVqqh169aKiIjQddddpyFDhgTmDRgwQCkpKWratKmcc6pWrZo++ugjJSQkaOzYsSpRooTKlSunyZMne9rn73Xu3FmbNm1Sq1atJGVerP/uu+/K5/OpUaNGmjRpkgYPHqz69evrvvvuO6N9AcidnaopPtiio6NdUlLSWdsf4NWmTZvUqFGjgi4DyLOUlJTAHYHnmoL4feMuPHhhZiudc9E5zeMUHgAAgEecwgNw1rVo0UJHjx4
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 720x360 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {
|
|
|
|
"needs_background": "light"
|
|
|
|
},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# Visualization 2\n",
|
|
|
|
"\n",
|
|
|
|
"newest_df.plot(kind = 'bar', figsize = (10, 5))"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 18,
|
2022-07-15 21:14:21 -04:00
|
|
|
"id": "6749209e",
|
2022-07-15 16:22:57 -04:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
2022-07-15 21:14:21 -04:00
|
|
|
"source": [
|
|
|
|
"# Conclusions\n",
|
|
|
|
"\n",
|
|
|
|
"# We lost a lot of data from the dataset by dropping the 's' values. Maybe we should have done mean imputation.\n",
|
|
|
|
"# Humanities Prep Academy scored higher in the English Regents exam than other high schools in Manhattan\n",
|
|
|
|
"# and higher than schools in other boroughs, for every year surveyed."
|
|
|
|
]
|
2022-07-11 21:42:36 -04:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
|
|
|
"display_name": "Python 3 (ipykernel)",
|
|
|
|
"language": "python",
|
|
|
|
"name": "python3"
|
|
|
|
},
|
|
|
|
"language_info": {
|
|
|
|
"codemirror_mode": {
|
|
|
|
"name": "ipython",
|
|
|
|
"version": 3
|
|
|
|
},
|
|
|
|
"file_extension": ".py",
|
|
|
|
"mimetype": "text/x-python",
|
|
|
|
"name": "python",
|
|
|
|
"nbconvert_exporter": "python",
|
|
|
|
"pygments_lexer": "ipython3",
|
|
|
|
"version": "3.10.4"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 5
|
|
|
|
}
|