human
I am working on the file "6_VisualizationSchoolGrouping.ipynb".
The first task is:
Mean, min, max graduation rates by state for export to the visualization.
Can you write Python program for it?
 ... Give me a the Python program you requested?
assistant
#Here is the Python program you requested.

#CITATION: http://stackoverflow.com/questions/17578115/pass-percentiles-to-pandas-agg-function
def percentile(n):
    def percentile_(x):
        return np.percentile(x, n)
    percentile_.__name__ = 'percentile_%s' % n
    return percentile_

stateresults = districts.groupby('State Name [District] Latest available year')['AFGR'].aggregate([np.min, percentile(25), np.mean, percentile(75), np.max])
stateresults.to_csv("data/finaldata/stateresults.csv")
stateresults.head(100)

districts['Urban-centric Locale [District] 2009-10'].value_counts()