In [1]:
import pandas as pd
I filtered the data below for schools in CA, in San Diego County, and that have either already been participating in F2S in some capacity or have just started in the 2014-2015 school year.
In [3]:
# Read in the excel file and display
census_df = pd.read_excel('2015 F2S Census SFA Data_6.27.16_web.xlsx', sheetname='2015 F2S Census + CCD')
census_df.head()
Out[3]:
In [8]:
# Filter the dataframe, fill na values, and display
census_df_CA = census_df[census_df['state'] == 'CA']
census_df_SD = census_df_CA[census_df_CA['CONAME'] == 'SAN DIEGO COUNTY']
census_df_SD = census_df_SD[census_df_SD['F2S'] <= 2]
census_df_SD.fillna(0, inplace=True)
census_df_SD.head()
Out[8]:
In [10]:
# Perform calculations and display
print('Number of school districts currently participating in F2S or started in 2014-2015 school year:',
len(list(census_df_SD['SFAname'].unique())))
print('Number of schools in those school districts:',
census_df_SD['schoolnum'].astype(int).sum())
print('Number of school gardens in those schools/districts:',
census_df_SD['gardennum'].astype(int).sum())
In [ ]: