In [2]:
%pylab inline
import json
import pandas as pd
In [3]:
schoolframe = pd.read_json('schoolsdupe.json')
schoolframe.head()
Out[3]:
In [7]:
schoolframe[schoolframe['county'].str.contains('Carlow')].groupby('destination').sum()['destinationnumber']
Out[7]:
In [10]:
schoolframe[schoolframe['private'].str.contains('True')].groupby('destination').sum()['destinationnumber']
Out[10]:
In [13]:
schoolframe[schoolframe['private'].str.contains('True')].sum()['destinationnumber']
Out[13]:
In [15]:
(100 * schoolframe[schoolframe['private'].str.contains('True')].groupby('destination').sum()['destinationnumber'] ) / schoolframe[schoolframe['private'].str.contains('True')].sum()['destinationnumber']
Out[15]:
In [11]:
schoolframe[schoolframe['private'].str.contains('False')].groupby('destination').sum()['destinationnumber']
Out[11]:
In [16]:
(100 * schoolframe[schoolframe['private'].str.contains('False')].groupby('destination').sum()['destinationnumber'] ) / schoolframe[schoolframe['private'].str.contains('False')].sum()['destinationnumber']
Out[16]:
In [ ]: