In [2]:
%pylab inline
import json
import pandas as pd


Populating the interactive namespace from numpy and matplotlib

In [3]:
schoolframe = pd.read_json('schoolsdupe.json')

schoolframe.head()


Out[3]:
county destination destinationnumber name percentage private totalnumber
0 Carlow Royal College of Surgeons 1 St Leo's College 100% False 134
1 Carlow NUI Galway 4 St Leo's College 100% False 134
2 Carlow St. Angela's Sligo 1 St Leo's College 100% False 134
3 Carlow Maynooth University 17 St Leo's College 100% False 134
4 Carlow University College Dublin 5 St Leo's College 100% False 134

In [7]:
schoolframe[schoolframe['county'].str.contains('Carlow')].groupby('destination').sum()['destinationnumber']


Out[7]:
destination
Athlone IT                              5
Cork IT                                 2
Dublin City University                 46
Dublin Institute of Technology         17
Dun Laoghaire IADT                      9
Dundalk IT                              3
Galway-Mayo IT                          7
IT Blanchardstown                       2
IT Carlow                             182
IT Sligo                                1
IT Tralee                               3
Letterkenny IT                          1
Limerick IT                             3
Marino Institute of Education           4
Mary Immaculate Limerick                1
Maynooth University                    63
NUI Galway                             22
National College of Art and Design      4
National College of Ireland             2
Royal College of Surgeons               2
St. Angela's Sligo                      2
Trinity College Dublin                 27
University College Cork                15
University College Dublin              34
University of Limerick                 17
University of Ulster                    1
Waterford Institue of Technology       82
Name: destinationnumber, dtype: int64

In [10]:
schoolframe[schoolframe['private'].str.contains('True')].groupby('destination').sum()['destinationnumber']


Out[10]:
destination
Athlone IT                               11
Church of Ireland College                 9
Cork IT                                  87
Dublin City University                  243
Dublin Institute of Technology          553
Dun Laoghaire IADT                      108
Dundalk IT                               39
Galway-Mayo IT                           14
IT Blanchardstown                        23
IT Carlow                                21
IT Sligo                                 28
IT Tallaght                              70
IT Tralee                                20
Letterkenny IT                            8
Limerick IT                              37
Marino Institute of Education             9
Mary Immaculate Limerick                 11
Maynooth University                     173
NUI Galway                              150
National College of Art and Design       31
National College of Ireland              46
Queen's University, Belfast               3
Royal College of Surgeons                22
Shannon College of Hotel Management       8
St. Angela's Sligo                        2
Trinity College Dublin                  704
University College Cork                 311
University College Dublin              1049
University of Limerick                   80
University of Ulster                      5
Waterford Institue of Technology         19
Name: destinationnumber, dtype: int64

In [13]:
schoolframe[schoolframe['private'].str.contains('True')].sum()['destinationnumber']


Out[13]:
3894

In [15]:
(100 * schoolframe[schoolframe['private'].str.contains('True')].groupby('destination').sum()['destinationnumber'] ) / schoolframe[schoolframe['private'].str.contains('True')].sum()['destinationnumber']


Out[15]:
destination
Athlone IT                              0.282486
Church of Ireland College               0.231125
Cork IT                                 2.234206
Dublin City University                  6.240370
Dublin Institute of Technology         14.201335
Dun Laoghaire IADT                      2.773498
Dundalk IT                              1.001541
Galway-Mayo IT                          0.359527
IT Blanchardstown                       0.590652
IT Carlow                               0.539291
IT Sligo                                0.719055
IT Tallaght                             1.797637
IT Tralee                               0.513611
Letterkenny IT                          0.205444
Limerick IT                             0.950180
Marino Institute of Education           0.231125
Mary Immaculate Limerick                0.282486
Maynooth University                     4.442732
NUI Galway                              3.852080
National College of Art and Design      0.796097
National College of Ireland             1.181305
Queen's University, Belfast             0.077042
Royal College of Surgeons               0.564972
Shannon College of Hotel Management     0.205444
St. Angela's Sligo                      0.051361
Trinity College Dublin                 18.079096
University College Cork                 7.986646
University College Dublin              26.938880
University of Limerick                  2.054443
University of Ulster                    0.128403
Waterford Institue of Technology        0.487930
Name: destinationnumber, dtype: float64

In [11]:
schoolframe[schoolframe['private'].str.contains('False')].groupby('destination').sum()['destinationnumber']


Out[11]:
destination
Athlone IT                              947
Church of Ireland College                18
Cork IT                                2002
Dublin City University                 2713
Dublin Institute of Technology         2682
Dun Laoghaire IADT                      444
Dundalk IT                             1084
Galway-Mayo IT                         1447
IT Blanchardstown                       806
IT Carlow                              1176
IT Sligo                               1013
IT Tallaght                             724
IT Tralee                               655
Letterkenny IT                          834
Limerick IT                            1387
Marino Institute of Education           163
Mary Immaculate Limerick                837
Maynooth University                    2508
NUI Galway                             2720
National College of Art and Design      223
National College of Ireland             467
Queen's University, Belfast              42
Royal College of Surgeons                92
Shannon College of Hotel Management      59
St. Angela's Sligo                      132
Trinity College Dublin                 1681
University College Cork                3128
University College Dublin              2742
University of Limerick                 2512
University of Ulster                     57
Waterford Institue of Technology       1861
Name: destinationnumber, dtype: int64

In [16]:
(100 * schoolframe[schoolframe['private'].str.contains('False')].groupby('destination').sum()['destinationnumber'] ) / schoolframe[schoolframe['private'].str.contains('False')].sum()['destinationnumber']


Out[16]:
destination
Athlone IT                             2.548714
Church of Ireland College              0.048444
Cork IT                                5.388093
Dublin City University                 7.301647
Dublin Institute of Technology         7.218215
Dun Laoghaire IADT                     1.194962
Dundalk IT                             2.917429
Galway-Mayo IT                         3.894391
IT Blanchardstown                      2.169232
IT Carlow                              3.165034
IT Sligo                               2.726343
IT Tallaght                            1.948541
IT Tralee                              1.762838
Letterkenny IT                         2.244590
Limerick IT                            3.732910
Marino Institute of Education          0.438691
Mary Immaculate Limerick               2.252664
Maynooth University                    6.749919
NUI Galway                             7.320487
National College of Art and Design     0.600172
National College of Ireland            1.256863
Queen's University, Belfast            0.113037
Royal College of Surgeons              0.247605
Shannon College of Hotel Management    0.158790
St. Angela's Sligo                     0.355259
Trinity College Dublin                 4.524168
University College Cork                8.418560
University College Dublin              7.379696
University of Limerick                 6.760685
University of Ulster                   0.153407
Waterford Institue of Technology       5.008612
Name: destinationnumber, dtype: float64

In [ ]: