In the 2015-2016 CRDC Survey, schools were required to report how many students were enrolled in at least one Dual Enrollment course (in addition to reporting the number of students enrolled in at least one AP Course). This new inclusion allows for the study of gross participation in these programs. Looking at the 18,667 high schools from the filtered CRDC dataset (for more details, see the intital filtration methodology), the results are reported below in the follow ways:
- Nationally
- By School 9-12th Grade Enrollment
- By School Locale
- By School Non-White Student Percentage
- By Student Gender
- By Student Race
- By Limited English Proficiency (LEP) / Individuals with Disabilities Education Act (IDEA) Students
- By State
- By Region (Accreditation)
- By Region (Census)
- By Region (NACEP)
from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')
from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import plotly.plotly as py
import plotly.graph_objs as go
from plotly.offline import init_notebook_mode,iplot
init_notebook_mode(connected = True)
%matplotlib inline
sns.set_style('whitegrid')
plt.rc('axes', titlesize = 14, titleweight = 'bold', labelweight = 'bold')
crdc_1516 = pd.read_csv('../filtered_data/04_filter_final.csv', dtype = {'LEAID':np.object})
Cleaning Specificially those for int-columns -- these are recorded as negative numbers that interfere with the enrollment calculations.
This section sets up most of the calculations needed for the analyses in the report.
crdc_1516_cleaned = crdc_1516.copy()
from my_functions.extra_functions import missing_value_mapper
crdc_1516_cleaned = crdc_1516_cleaned.applymap(missing_value_mapper)
"""Total Enrollments"""
crdc_1516_cleaned['total_enrollment'] = crdc_1516_cleaned['TOT_ENR_M'] + crdc_1516_cleaned['TOT_ENR_F']
crdc_1516_cleaned['total_white_enrollment'] = crdc_1516_cleaned['SCH_ENR_WH_M'] + crdc_1516_cleaned['SCH_ENR_WH_F']
crdc_1516_cleaned['total_nonwhite_enrollment'] = crdc_1516_cleaned['total_enrollment'] - crdc_1516_cleaned['total_white_enrollment']
crdc_1516_cleaned['total_hi_enrollment'] = crdc_1516_cleaned['SCH_ENR_HI_M'] + crdc_1516_cleaned['SCH_ENR_HI_F']
crdc_1516_cleaned['total_am_enrollment'] = crdc_1516_cleaned['SCH_ENR_AM_M'] + crdc_1516_cleaned['SCH_ENR_AM_F']
crdc_1516_cleaned['total_as_enrollment'] = crdc_1516_cleaned['SCH_ENR_AS_M'] + crdc_1516_cleaned['SCH_ENR_AS_F']
crdc_1516_cleaned['total_bl_enrollment'] = crdc_1516_cleaned['SCH_ENR_BL_M'] + crdc_1516_cleaned['SCH_ENR_BL_F']
crdc_1516_cleaned['total_hp_enrollment'] = crdc_1516_cleaned['SCH_ENR_HP_M'] + crdc_1516_cleaned['SCH_ENR_HP_F']
crdc_1516_cleaned['total_tr_enrollment'] = crdc_1516_cleaned['SCH_ENR_TR_M'] + crdc_1516_cleaned['SCH_ENR_TR_F']
crdc_1516_cleaned['total_lep_enrollment'] = crdc_1516_cleaned['SCH_ENR_LEP_M'] + crdc_1516_cleaned['SCH_ENR_LEP_F']
crdc_1516_cleaned['total_idea_enrollment'] = crdc_1516_cleaned['SCH_ENR_IDEA_M'] + crdc_1516_cleaned['SCH_ENR_IDEA_F']
"""DE Columns"""
crdc_1516_cleaned['de_total_enrollment'] = crdc_1516_cleaned['TOT_DUALENR_M'] + crdc_1516_cleaned['TOT_DUALENR_F']
crdc_1516_cleaned['de_white_enrollment'] = crdc_1516_cleaned['SCH_DUALENR_WH_F'] + crdc_1516_cleaned['SCH_DUALENR_WH_M']
crdc_1516_cleaned['de_nonwhite_enrollment'] = crdc_1516_cleaned['de_total_enrollment'] - crdc_1516_cleaned['de_white_enrollment']
crdc_1516_cleaned['de_hi_enrollment'] = crdc_1516_cleaned['SCH_DUALENR_HI_M'] + crdc_1516_cleaned['SCH_DUALENR_HI_F']
crdc_1516_cleaned['de_am_enrollment'] = crdc_1516_cleaned['SCH_DUALENR_AM_M'] + crdc_1516_cleaned['SCH_DUALENR_AM_F']
crdc_1516_cleaned['de_as_enrollment'] = crdc_1516_cleaned['SCH_DUALENR_AS_M'] + crdc_1516_cleaned['SCH_DUALENR_AS_F']
crdc_1516_cleaned['de_bl_enrollment'] = crdc_1516_cleaned['SCH_DUALENR_BL_M'] + crdc_1516_cleaned['SCH_DUALENR_BL_F']
crdc_1516_cleaned['de_hp_enrollment'] = crdc_1516_cleaned['SCH_DUALENR_HP_M'] + crdc_1516_cleaned['SCH_DUALENR_HP_F']
crdc_1516_cleaned['de_tr_enrollment'] = crdc_1516_cleaned['SCH_DUALENR_TR_M'] + crdc_1516_cleaned['SCH_DUALENR_TR_F']
crdc_1516_cleaned['de_lep_enrollment'] = crdc_1516_cleaned['SCH_DUALENR_LEP_M'] + crdc_1516_cleaned['SCH_DUALENR_LEP_F']
crdc_1516_cleaned['de_idea_enrollment'] = crdc_1516_cleaned['SCH_DUALENR_IDEA_M'] + crdc_1516_cleaned['SCH_DUALENR_IDEA_F']
"""AP Columns"""
crdc_1516_cleaned['ap_total_enrollment'] = crdc_1516_cleaned['TOT_APENR_M'] + crdc_1516_cleaned['TOT_APENR_F']
crdc_1516_cleaned['ap_white_enrollment'] = crdc_1516_cleaned['SCH_APENR_WH_F'] + crdc_1516_cleaned['SCH_APENR_WH_M']
crdc_1516_cleaned['ap_nonwhite_enrollment'] = crdc_1516_cleaned['ap_total_enrollment'] - crdc_1516_cleaned['ap_white_enrollment']
crdc_1516_cleaned['ap_hi_enrollment'] = crdc_1516_cleaned['SCH_APENR_HI_M'] + crdc_1516_cleaned['SCH_APENR_HI_F']
crdc_1516_cleaned['ap_am_enrollment'] = crdc_1516_cleaned['SCH_APENR_AM_M'] + crdc_1516_cleaned['SCH_APENR_AM_F']
crdc_1516_cleaned['ap_as_enrollment'] = crdc_1516_cleaned['SCH_APENR_AS_M'] + crdc_1516_cleaned['SCH_APENR_AS_F']
crdc_1516_cleaned['ap_bl_enrollment'] = crdc_1516_cleaned['SCH_APENR_BL_M'] + crdc_1516_cleaned['SCH_APENR_BL_F']
crdc_1516_cleaned['ap_hp_enrollment'] = crdc_1516_cleaned['SCH_APENR_HP_M'] + crdc_1516_cleaned['SCH_APENR_HP_F']
crdc_1516_cleaned['ap_tr_enrollment'] = crdc_1516_cleaned['SCH_APENR_TR_M'] + crdc_1516_cleaned['SCH_APENR_TR_F']
crdc_1516_cleaned['ap_lep_enrollment'] = crdc_1516_cleaned['SCH_APENR_LEP_M'] + crdc_1516_cleaned['SCH_APENR_LEP_F']
crdc_1516_cleaned['ap_idea_enrollment'] = crdc_1516_cleaned['SCH_APENR_IDEA_M'] + crdc_1516_cleaned['SCH_APENR_IDEA_F']
"""Helper Functions"""
from my_functions.extra_functions import (hs_enrollment_averager, school_sizer,
region_mapper, eth_grouper, locale_map, region_mapper_nacep,
region_mapper_census)
"""HS-Averaged Column"""
crdc_1516_cleaned['hs_total_enrollment'] = hs_enrollment_averager(crdc_1516_cleaned)
"""HS Category Breakdown"""
crdc_1516_cleaned['hs_male'] = round((crdc_1516_cleaned['TOT_ENR_M'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_female'] = round((crdc_1516_cleaned['TOT_ENR_F'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_white'] = round((crdc_1516_cleaned['total_white_enrollment'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_nonwhite'] = round((crdc_1516_cleaned['total_nonwhite_enrollment'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_hi'] = round((crdc_1516_cleaned['total_hi_enrollment'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_am'] = round((crdc_1516_cleaned['total_am_enrollment'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_as'] = round((crdc_1516_cleaned['total_as_enrollment'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_bl'] = round((crdc_1516_cleaned['total_bl_enrollment'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_hp'] = round((crdc_1516_cleaned['total_hp_enrollment'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_tr'] = round((crdc_1516_cleaned['total_tr_enrollment'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_idea'] = round((crdc_1516_cleaned['total_idea_enrollment'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
crdc_1516_cleaned['hs_lep'] = round((crdc_1516_cleaned['total_lep_enrollment'] / crdc_1516_cleaned['total_enrollment']) * crdc_1516_cleaned['hs_total_enrollment'],0)
"""Add HS Enrollment-Grouped Column"""
crdc_1516_cleaned['size_group'] = crdc_1516_cleaned['hs_total_enrollment'].apply(lambda x: school_sizer(x))
"""Add Region Columns"""
crdc_1516_cleaned['region_accred'] = crdc_1516_cleaned['LEA_STATE'].apply(lambda x: region_mapper(x))
crdc_1516_cleaned['region_census'] = crdc_1516_cleaned['LEA_STATE'].apply(lambda x: region_mapper_census(x))
crdc_1516_cleaned['region_nacep'] = crdc_1516_cleaned['LEA_STATE'].apply(lambda x: region_mapper_nacep(x))
"""Add Ethnicity Percentage/Quintile"""
crdc_1516_cleaned['pct_eth'] = crdc_1516_cleaned['total_nonwhite_enrollment'] / crdc_1516_cleaned['total_enrollment']
crdc_1516_cleaned['eth_quintile'] = crdc_1516_cleaned['pct_eth'].apply(lambda pct: eth_grouper(pct))
"""Add Locale Column"""
crdc_1516_cleaned['locale_group'] = crdc_1516_cleaned['LOCALE15'].map(locale_map)
from my_functions.extra_functions import school_grade_range, have_gr9_or_younger
DE
crdc_1516_deYes = crdc_1516_cleaned[crdc_1516_cleaned.SCH_DUAL_IND == 'Yes']
"""Number of schools which responded 'Yes' to the DE_Flag """
print(len(crdc_1516_deYes), 'Schools reported "Yes" to Dual Enrollment Flag Question')
"""Grade Ranges for Schools with DE Students"""
deYes_grade_range_list = school_grade_range(crdc_1516_deYes).join(crdc_1516_deYes[['total_enrollment', 'de_total_enrollment']].reset_index(drop = True), how = 'outer')
deYes_grade_range_dist = deYes_grade_range_list['grade_range'].value_counts().reset_index().sort_values('index').set_index('index')
deYes_grade_range_dist['pct_of_schools'] = round(deYes_grade_range_dist['grade_range'] / len(deYes_grade_range_list), 3)
deYes_grade_range_enrollments = pd.DataFrame(deYes_grade_range_list.groupby('grade_range')['total_enrollment'].sum())
deYes_grade_range_enrollments['pct_of_total_enrollment'] = round(deYes_grade_range_enrollments['total_enrollment'] / crdc_1516_deYes['total_enrollment'].sum(), 3)
deYes_grade_range_de_enrollments = pd.DataFrame(deYes_grade_range_list.groupby('grade_range')['de_total_enrollment'].sum())
deYes_grade_range_de_enrollments['pct_of_total_de_enrollment'] = round(deYes_grade_range_de_enrollments['de_total_enrollment'] / crdc_1516_deYes['de_total_enrollment'].sum(), 3)
deYes_grade_range_dist.index.names = ['Grade Ranges']
deYes_grade_range_dist.join(deYes_grade_range_enrollments).join(deYes_grade_range_de_enrollments).rename({'grade_range': '# schools'}, axis = 1)
AP
crdc_1516_apYes = crdc_1516_cleaned[crdc_1516_cleaned.SCH_APENR_IND == 'Yes']
"""Number of schools which responded 'Yes' to the AP_Flag """
len(crdc_1516_apYes)
"""Grade Ranges for Schools with AP Students"""
apYes_grade_range_list = school_grade_range(crdc_1516_apYes).join(crdc_1516_apYes[['total_enrollment', 'ap_total_enrollment']].reset_index(drop = True), how = 'outer')
apYes_grade_range_dist = apYes_grade_range_list['grade_range'].value_counts().reset_index().sort_values('index').set_index('index')
apYes_grade_range_dist['pct_of_schools'] = round(apYes_grade_range_dist['grade_range'] / len(apYes_grade_range_list), 3)
apYes_grade_range_enrollments = pd.DataFrame(apYes_grade_range_list.groupby('grade_range')['total_enrollment'].sum())
apYes_grade_range_enrollments['pct_of_total_enrollment'] = round(apYes_grade_range_enrollments['total_enrollment'] / crdc_1516_apYes['total_enrollment'].sum(), 3)
apYes_grade_range_ap_enrollments = pd.DataFrame(apYes_grade_range_list.groupby('grade_range')['ap_total_enrollment'].sum())
apYes_grade_range_ap_enrollments['pct_of_total_ap_enrollment'] = round(apYes_grade_range_ap_enrollments['ap_total_enrollment'] / crdc_1516_apYes['ap_total_enrollment'].sum(), 3)
apYes_grade_range_dist.index.names = ['Grade Ranges']
apYes_grade_range_dist.join(apYes_grade_range_enrollments).join(apYes_grade_range_ap_enrollments).rename({'grade_range': '# schools'}, axis = 1)
"""Helper Functions"""
from my_functions.extra_functions import by_offering_enrollment_compiler, by_offering_enrollment_compiler_layerer
deYes_enrollment = crdc_1516_deYes['hs_total_enrollment'].sum() # Based on the Averager Function
de_total_enrollment = crdc_1516_cleaned['de_total_enrollment'].sum()
de_participation_rate = round(de_total_enrollment / deYes_enrollment * 100, 1)
apYes_enrollment = crdc_1516_apYes['hs_total_enrollment'].sum() # Based on the Averager Function
ap_total_enrollment = crdc_1516_cleaned['ap_total_enrollment'].sum()
ap_participation_rate = round(ap_total_enrollment / apYes_enrollment * 100, 1)
national_order = ['Total HS in DE Offering', 'Total DE Students', 'DE Participation Rate',
'Total HS in AP Offering', 'Total AP Students', 'AP Participation Rate']
national_frame = pd.DataFrame({'Total HS in DE Offering': [deYes_enrollment],
'Total DE Students': [de_total_enrollment],
'DE Participation Rate': [de_participation_rate],
'Total HS in AP Offering': [apYes_enrollment],
'Total AP Students': [ap_total_enrollment],
'AP Participation Rate': [ap_participation_rate]},
index = ['National'])[national_order]
national_frame
- Schools were grouped into four categories based on how many students were enrolled in grades 9-12 in each one:
- <100
- 100 - 499
- 500 - 1199
- 1200+
size_enrollments = by_offering_enrollment_compiler(crdc_1516_deYes, crdc_1516_apYes, 'size_group')
size_enrollments = size_enrollments.rename({1: '<100', 2: '100-499', 3:'500-1199', 4:'1200+'})
size_enrollments.index.name = 'HS Student Enrollment'
size_enrollments
f, (ax1,ax2) = plt.subplots(2,1, figsize = (10,10))
plt.sca(ax1)
a1 = size_enrollments.plot.pie(y = 'DE Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = -90, pctdistance=1.25, labels = None, fontsize = 13, ax=ax1)
plt.legend(labels = size_enrollments.index,
bbox_to_anchor = (1,0.71), title = 'Size Groups',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total DE Enrollment by School Size Groups')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a1.add_artist(centre_circle)
a1.axis('equal')
plt.sca(ax2)
a2 = size_enrollments.plot.pie(y = 'AP Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = -28, pctdistance=1.25, labels = None, fontsize = 13, ax=ax2)
plt.legend(labels = size_enrollments.index,
bbox_to_anchor = (1,0.71), title = 'Size Groups',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total AP Enrollment by School Size Groups')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a2.add_artist(centre_circle)
a2.axis('equal')
plt.show()
- Schools were grouped into four categories based on their locale (as defined by the NCES):
- City: "Territory inside an Urbanized Area and inside a Principal City"
- Rural: "Census-defined rural territory"
- Suburban: "Territory outside a Principal City and inside an Urbanized Area"
- Town: "Territory inside an Urban Cluster"
locale_enrollments = by_offering_enrollment_compiler(crdc_1516_deYes, crdc_1516_apYes, 'locale_group')
locale_enrollments.index.name = 'Locale'
locale_enrollments
f, (ax1,ax2) = plt.subplots(2,1, figsize = (10,10))
plt.sca(ax1)
a1 = locale_enrollments.plot.pie(y = 'DE Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = -90, pctdistance=1.25, labels = None, fontsize = 13, ax=ax1)
plt.legend(labels = locale_enrollments.index,
bbox_to_anchor = (1,0.71), title = 'Locales',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total DE Enrollment by School Locale')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a1.add_artist(centre_circle)
a1.axis('equal')
plt.sca(ax2)
a2 = locale_enrollments.plot.pie(y = 'AP Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = -100, pctdistance=1.25, labels = None, fontsize = 13, ax=ax2)
plt.legend(labels = locale_enrollments.index,
bbox_to_anchor = (1,0.71), title = 'Locales',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total AP Enrollment by School Locale')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a2.add_artist(centre_circle)
a2.axis('equal')
plt.show()
eth_enrollments = by_offering_enrollment_compiler(crdc_1516_deYes, crdc_1516_apYes, 'eth_quintile')
eth_enrollments = eth_enrollments.rename({1:'0-20%', 2:'21-40%', 3:'41-60%', 4:'61-80%', 5:'81-100%'})
eth_enrollments.index.name = 'Non-White %'
eth_enrollments
f, (ax1,ax2) = plt.subplots(2,1, figsize = (10,10))
plt.sca(ax1)
a1 = eth_enrollments.plot.pie(y = 'DE Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = -29, pctdistance=1.25, labels = None, fontsize = 13, ax=ax1)
plt.legend(labels = ['0-20%', '21-40%', '41-60%', '61-80%', '81-100%'],
bbox_to_anchor = (1,0.71), title = 'Percentage Non-White Groups',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total DE Enrollment by School Ethnicity Groups')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a1.add_artist(centre_circle)
a1.axis('equal')
plt.sca(ax2)
a2 = eth_enrollments.plot.pie(y = 'AP Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = 11, pctdistance=1.25, labels = None, fontsize = 13, ax=ax2)
plt.legend(labels = ['0-20%', '21-40%', '41-60%', '61-80%', '81-100%'],
bbox_to_anchor = (1,0.71), title = 'Percentage Non-White Groups',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total AP Enrollment by School Ethnicity Groups')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a2.add_artist(centre_circle)
a2.axis('equal')
plt.show()
male_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_male', 'TOT_DUALENR_M', 'TOT_APENR_M', 'Male')
female_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_female', 'TOT_DUALENR_F', 'TOT_APENR_F', 'Female')
gender_enrollments = pd.concat([male_enroll, female_enroll])
gender_enrollments.index.name = 'Gender'
gender_enrollments
f, (ax1,ax2) = plt.subplots(2,1, figsize = (10,10))
plt.sca(ax1)
a1 = gender_enrollments.plot.pie(y = 'DE Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = 90, pctdistance=1.25, labels = None, fontsize = 13, ax=ax1)
plt.legend(labels = gender_enrollments.index,
bbox_to_anchor = (1,0.71), title = 'Genders',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total DE Enrollment by Genders')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a1.add_artist(centre_circle)
a1.axis('equal')
plt.sca(ax2)
a2 = gender_enrollments.plot.pie(y = 'AP Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = 90, pctdistance=1.25, labels = None, fontsize = 13, ax=ax2)
plt.legend(labels = gender_enrollments.index,
bbox_to_anchor = (1,0.71), title = 'Genders',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total AP Enrollment by Genders')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a2.add_artist(centre_circle)
a2.axis('equal')
plt.show()
hi_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_hi', 'de_hi_enrollment', 'ap_hi_enrollment', 'Hispanic')
am_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_am', 'de_am_enrollment', 'ap_am_enrollment', 'American Indian / Native Alaskan')
as_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_as', 'de_as_enrollment', 'ap_as_enrollment', 'Asian')
bl_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_bl', 'de_bl_enrollment', 'ap_bl_enrollment', 'Black')
hp_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_hp', 'de_hp_enrollment', 'ap_hp_enrollment', 'Native Hawaiian / Pacific Islander')
tr_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_tr', 'de_tr_enrollment', 'ap_tr_enrollment', 'Two or More Races')
wh_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_white', 'de_white_enrollment', 'ap_white_enrollment', 'White')
race_enrollment = pd.concat([hi_enroll, am_enroll, as_enroll, bl_enroll, hp_enroll, tr_enroll, wh_enroll])
race_enrollment.index.name = 'Race'
race_enrollment
f, (ax1,ax2) = plt.subplots(2,1, figsize = (10,10))
plt.sca(ax1)
a1 = race_enrollment.plot.pie(y = 'DE Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(race_enrollment))],
startangle = -70, pctdistance=1.25, labels = None, fontsize = 13, ax=ax1)
plt.legend(labels = race_enrollment.index,
bbox_to_anchor = (.82,0.71), title = 'Races',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total DE Enrollment by Race')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a1.add_artist(centre_circle)
a1.axis('equal')
plt.sca(ax2)
a2 = race_enrollment.plot.pie(y = 'AP Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(race_enrollment))],
startangle = -110, pctdistance=1.25, labels = None, fontsize = 13, ax=ax2)
plt.legend(labels = race_enrollment.index,
bbox_to_anchor = (.82,0.71), title = 'Races',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total AP Enrollment by Race')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a2.add_artist(centre_circle)
a2.axis('equal')
plt.show()
lep_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_lep', 'de_lep_enrollment', 'ap_lep_enrollment', 'LEP')
idea_enroll = by_offering_enrollment_compiler_layerer(crdc_1516_deYes, crdc_1516_apYes, 'hs_idea', 'de_idea_enrollment', 'ap_idea_enrollment', 'IDEA')
lep_idea_enrollments = pd.concat([lep_enroll, idea_enroll])
lep_idea_enrollments
- Sorted by DE Participation Rate in Descending Order
state_enrollments = by_offering_enrollment_compiler(crdc_1516_deYes, crdc_1516_apYes, 'LEA_STATE')
state_enrollments.index.name = 'State'
state_enrollments.sort_values('DE Participation Rate', ascending=False)
plt.figure(figsize=(6,6))
plt.scatter(x=state_enrollments['DE Participation Rate'], y=state_enrollments['AP Participation Rate'])
plt.ylim([0,30])
plt.xlim([0,30])
plt.ylabel('%High School Students in State Taking AP')
plt.xlabel('%High School Students in State Taking DE')
plt.yticks(np.arange(0,35,5))
plt.xticks(np.arange(0,35,5))
plt.title('States: AP v DE Participation Rates')
plt.show()
- Regions are broken down according to the regional accreditation guidelines.
- Higher Learning Commission (HLC): Arkansas, Arizona, Colorado, Iowa, Illinois, Indiana, Kansas, Michigan,
Minnesota, Missouri, North Dakota, Nebraska, New Mexico, Ohio, Oklahoma, South Dakota, Wisconsin,
West Virginia, and Wyoming.
- Middle States Commission on Higher Education (MSCHE): New York, New Jersey, Pennsylvania, Delaware,
Maryland, the District of Columbia.
- New England Association of Schools and Colleges (NEASC): Connecticut, Maine, Massachusetts, New Hampshire,
Rhode Island, and Vermont.
- Northwest Commission on Colleges and Universities (NWCCU): Alaska, Idaho, Montana, Nevada, Oregon,
Utah, and Washington.
- Southern Association of Colleges and Schools (SACS): Alabama, Florida, Georgia, Kentucky,
Louisiana, Mississippi, North Carolina, South Carolina, Tennessee, Texas and Virginia.
- Western Association of Schools and Colleges (WASC): Hawaii, California
region_enrollment = by_offering_enrollment_compiler(crdc_1516_deYes, crdc_1516_apYes, 'region_accred')
region_enrollment.index.name = 'Region'
region_enrollment
f, (ax1,ax2) = plt.subplots(2,1, figsize = (10,10))
plt.sca(ax1)
a1 = region_enrollment.plot.pie(y = 'DE Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = -29, pctdistance=1.25, labels = None, fontsize = 13, ax=ax1)
plt.legend(labels = region_enrollment.index,
bbox_to_anchor = (1,0.71), title = 'Regions',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total DE Enrollment by Region (Accreditation)')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a1.add_artist(centre_circle)
a1.axis('equal')
plt.sca(ax2)
a2 = region_enrollment.plot.pie(y = 'AP Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = 11, pctdistance=1.25, labels = None, fontsize = 13, ax=ax2)
plt.legend(labels = region_enrollment.index,
bbox_to_anchor = (1,0.71), title = 'Regions',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total AP Enrollment by Region (Accreditation)')
centre_circle = plt.Circle((0,0),0.6,fc='white')
a2.add_artist(centre_circle)
a2.axis('equal')
plt.show()
- Regions are broken down according to the regional accreditation guidelines.
- New England - Connecticut, Maine, Massachusetts, New Hampshire, Rhode Island, and Vermont
- Mid-Atlantic - New Jersey, New York, and Pennsylvania
- East North Central - Illinois, Indiana, Michigan, Ohio, and Wisconsin
- West North Central - Iowa, Kansas, Minnesota, Missouri, Nebraska, North Dakota, and South Dakota
- South Atlantic - Delaware, Florida, Georgia, Maryland, North Carolina, South Carolina,
Virginia, District of Columbia, and West Virginia
- East South Central - Alabama, Kentucky, Mississippi, and Tennessee
- West South Central - Arkansas, Louisiana, Oklahoma, and Texas
- Mountain - Arizona, Colorado, Idaho, Montana, Nevada, New Mexico, Utah, and Wyoming
- Pacific - Alaska, California, Hawaii, Oregon, and Washington
region_enrollment_census = by_offering_enrollment_compiler(crdc_1516_deYes, crdc_1516_apYes, 'region_census')
region_enrollment_census.index.name = 'Region'
region_enrollment_census
f, (ax1,ax2) = plt.subplots(2, 1, figsize = (10,10))
plt.sca(ax1)
a1 = region_enrollment_census.plot.pie(y = 'DE Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = -29, pctdistance=1.2, labels = None, fontsize = 13, ax=ax1)
plt.legend(labels = region_enrollment_census.index,
bbox_to_anchor = (1,0.71), title = 'Regions',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total DE Enrollment by Region (Census)', y = 1.1)
centre_circle = plt.Circle((0,0),0.6,fc='white')
a1.add_artist(centre_circle)
a1.axis('equal')
plt.sca(ax2)
a2 = region_enrollment_census.plot.pie(y = 'AP Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = 0, pctdistance=1.2, labels = None, fontsize = 13, ax=ax2)
plt.legend(labels = region_enrollment_census.index,
bbox_to_anchor = (1,0.71), title = 'Regions',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total AP Enrollment by Region (Census)', y = 1.1)
centre_circle = plt.Circle((0,0),0.6,fc='white')
a2.add_artist(centre_circle)
a2.axis('equal')
plt.tight_layout(pad= 1.5, h_pad = 5)
plt.show()
- Regions are broken down according to the regional accreditation guidelines.
- 1 - New York, New Jersey, Pennslyvania, Delware, Maryland, Washington DC, Connecticut, Maine,
Massachusettes, New Hampshire, Rhode Island, Vermont, Virginia
- 2 - Michigan, Indiana, Ohio, West Virigina, Kentukcy, Tennessee, North Carolina, South Carolina,
Alabama, Mississippi, Georgia, Florida
- 3 - Illinois, Missouri, Arkansas, Louisiana, Oklahoma, Kansas, Texas
- 4 - Montana, Idaho, Wyoming, North Dakota, South Dakota, Nebraska, Iowa, Minnesota, Wisconsin
- 5 - Oregan, Washington, California, Nevada, Utah, Arizona, Colorado, New Mexico, Alaska, Hawaii
region_enrollment_nacep = by_offering_enrollment_compiler(crdc_1516_deYes, crdc_1516_apYes, 'region_nacep')
region_enrollment_nacep.index.name = 'Region'
region_enrollment_nacep
f, (ax1,ax2) = plt.subplots(2,1, figsize = (10,10))
plt.sca(ax1)
a1 = region_enrollment_nacep.plot.pie(y = 'DE Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = -29, pctdistance=1.2, labels = None, fontsize = 13, ax=ax1)
plt.legend(labels = region_enrollment_nacep.index,
bbox_to_anchor = (1,0.71), title = 'Regions',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total DE Enrollment by Region (NACEP)', y=1.1)
centre_circle = plt.Circle((0,0),0.6,fc='white')
a1.add_artist(centre_circle)
a1.axis('equal')
plt.sca(ax2)
a2 = region_enrollment_nacep.plot.pie(y = 'AP Students',
autopct='%1.1f%%', #explode = [.05 for i in range(len(eth_enrollments))],
startangle = -29, pctdistance=1.2, labels = None, fontsize = 13, ax=ax2)
plt.legend(labels = region_enrollment_nacep.index,
bbox_to_anchor = (1,0.71), title = 'Regions',
frameon=True)
plt.ylabel('')
plt.title('Percentage of Total AP Enrollment by Region (NACEP)', y=1.1)
centre_circle = plt.Circle((0,0),0.6,fc='white')
a2.add_artist(centre_circle)
a2.axis('equal')
plt.tight_layout(h_pad=5)
plt.show()