In [1]:
import pandas as pd
import numpy as np
df = pd.read_csv('Dataset.csv')

In [2]:
df.head()


Out[2]:
LGD2014 All usual residents Unnamed: 2 Passports held: No passport Passports held: United Kingdom only Passports held: Ireland only Passports held: United Kingdom and Ireland only Passports held: United Kingdom and other (not Ireland) Passports held: Ireland and other (not United Kingdom) Passports held: EU/EEA (not United Kingdom or Ireland) Passports held: Other Passports held: No passport (%) Passports held: United Kingdom only (%) Passports held: Ireland only (%) Passports held: United Kingdom and Ireland only (%) Passports held: United Kingdom and other (not Ireland) (%) Passports held: Ireland and other (not United Kingdom) (%) Passports held: EU/EEA (not United Kingdom or Ireland) (%) Passports held: Other (%)
0 Northern Ireland 1,810,863 NaN 341,428 1,035,451 342,887 30,276 4,291 2,282 39,103 15,145 18.85 57.18 18.94 1.67 0.24 0.13 2.16 0.84
1 Antrim and Newtownabbey 138,567 NaN 21,744 96,539 14,018 2,098 355 128 2,371 1,314 15.69 69.67 10.12 1.51 0.26 0.09 1.71 0.95
2 Ards and North Down 156,672 NaN 22,496 120,061 7,758 3,031 593 118 1,448 1,167 14.36 76.63 4.95 1.93 0.38 0.08 0.92 0.74
3 Armagh City, Banbridge and Craigavon 199,693 NaN 38,671 113,450 35,740 3,043 406 169 7,050 1,164 19.37 56.81 17.90 1.52 0.20 0.08 3.53 0.58
4 Belfast 333,871 NaN 53,584 186,552 72,428 6,794 1,040 484 7,302 5,687 16.05 55.88 21.69 2.03 0.31 0.14 2.19 1.70

In [3]:
df['All usual residents'] = pd.to_numeric(df['All usual residents'].str.replace(',', ''))
df['Passports held: No passport'] = pd.to_numeric(df['Passports held: No passport'].str.replace(',', ''))
df['Passports held: United Kingdom only'] = pd.to_numeric(df['Passports held: United Kingdom only'].str.replace(',', ''))
df['Passports held: Ireland only'] = pd.to_numeric(df['Passports held: Ireland only'].str.replace(',', ''))
df['Passports held: United Kingdom and Ireland only'] = pd.to_numeric(df['Passports held: United Kingdom and Ireland only'].str.replace(',', ''))
df['Passports held: United Kingdom and other (not Ireland)'] = pd.to_numeric(df['Passports held: United Kingdom and other (not Ireland)'].str.replace(',', ''))
df['Passports held: Ireland and other (not United Kingdom)'] = pd.to_numeric(df['Passports held: Ireland and other (not United Kingdom)'].str.replace(',', ''))
df['Passports held: EU/EEA (not United Kingdom or Ireland)'] = pd.to_numeric(df['Passports held: EU/EEA (not United Kingdom or Ireland)'].str.replace(',', ''))
df['Passports held: Other'] = pd.to_numeric(df['Passports held: Other'].str.replace(',', ''))


df.head()


Out[3]:
LGD2014 All usual residents Unnamed: 2 Passports held: No passport Passports held: United Kingdom only Passports held: Ireland only Passports held: United Kingdom and Ireland only Passports held: United Kingdom and other (not Ireland) Passports held: Ireland and other (not United Kingdom) Passports held: EU/EEA (not United Kingdom or Ireland) Passports held: Other Passports held: No passport (%) Passports held: United Kingdom only (%) Passports held: Ireland only (%) Passports held: United Kingdom and Ireland only (%) Passports held: United Kingdom and other (not Ireland) (%) Passports held: Ireland and other (not United Kingdom) (%) Passports held: EU/EEA (not United Kingdom or Ireland) (%) Passports held: Other (%)
0 Northern Ireland 1810863 NaN 341428 1035451 342887 30276 4291 2282 39103 15145 18.85 57.18 18.94 1.67 0.24 0.13 2.16 0.84
1 Antrim and Newtownabbey 138567 NaN 21744 96539 14018 2098 355 128 2371 1314 15.69 69.67 10.12 1.51 0.26 0.09 1.71 0.95
2 Ards and North Down 156672 NaN 22496 120061 7758 3031 593 118 1448 1167 14.36 76.63 4.95 1.93 0.38 0.08 0.92 0.74
3 Armagh City, Banbridge and Craigavon 199693 NaN 38671 113450 35740 3043 406 169 7050 1164 19.37 56.81 17.90 1.52 0.20 0.08 3.53 0.58
4 Belfast 333871 NaN 53584 186552 72428 6794 1040 484 7302 5687 16.05 55.88 21.69 2.03 0.31 0.14 2.19 1.70

In [4]:
df.head()


Out[4]:
LGD2014 All usual residents Unnamed: 2 Passports held: No passport Passports held: United Kingdom only Passports held: Ireland only Passports held: United Kingdom and Ireland only Passports held: United Kingdom and other (not Ireland) Passports held: Ireland and other (not United Kingdom) Passports held: EU/EEA (not United Kingdom or Ireland) Passports held: Other Passports held: No passport (%) Passports held: United Kingdom only (%) Passports held: Ireland only (%) Passports held: United Kingdom and Ireland only (%) Passports held: United Kingdom and other (not Ireland) (%) Passports held: Ireland and other (not United Kingdom) (%) Passports held: EU/EEA (not United Kingdom or Ireland) (%) Passports held: Other (%)
0 Northern Ireland 1810863 NaN 341428 1035451 342887 30276 4291 2282 39103 15145 18.85 57.18 18.94 1.67 0.24 0.13 2.16 0.84
1 Antrim and Newtownabbey 138567 NaN 21744 96539 14018 2098 355 128 2371 1314 15.69 69.67 10.12 1.51 0.26 0.09 1.71 0.95
2 Ards and North Down 156672 NaN 22496 120061 7758 3031 593 118 1448 1167 14.36 76.63 4.95 1.93 0.38 0.08 0.92 0.74
3 Armagh City, Banbridge and Craigavon 199693 NaN 38671 113450 35740 3043 406 169 7050 1164 19.37 56.81 17.90 1.52 0.20 0.08 3.53 0.58
4 Belfast 333871 NaN 53584 186552 72428 6794 1040 484 7302 5687 16.05 55.88 21.69 2.03 0.31 0.14 2.19 1.70

In [5]:
df


Out[5]:
LGD2014 All usual residents Unnamed: 2 Passports held: No passport Passports held: United Kingdom only Passports held: Ireland only Passports held: United Kingdom and Ireland only Passports held: United Kingdom and other (not Ireland) Passports held: Ireland and other (not United Kingdom) Passports held: EU/EEA (not United Kingdom or Ireland) Passports held: Other Passports held: No passport (%) Passports held: United Kingdom only (%) Passports held: Ireland only (%) Passports held: United Kingdom and Ireland only (%) Passports held: United Kingdom and other (not Ireland) (%) Passports held: Ireland and other (not United Kingdom) (%) Passports held: EU/EEA (not United Kingdom or Ireland) (%) Passports held: Other (%)
0 Northern Ireland 1810863 NaN 341428 1035451 342887 30276 4291 2282 39103 15145 18.85 57.18 18.94 1.67 0.24 0.13 2.16 0.84
1 Antrim and Newtownabbey 138567 NaN 21744 96539 14018 2098 355 128 2371 1314 15.69 69.67 10.12 1.51 0.26 0.09 1.71 0.95
2 Ards and North Down 156672 NaN 22496 120061 7758 3031 593 118 1448 1167 14.36 76.63 4.95 1.93 0.38 0.08 0.92 0.74
3 Armagh City, Banbridge and Craigavon 199693 NaN 38671 113450 35740 3043 406 169 7050 1164 19.37 56.81 17.90 1.52 0.20 0.08 3.53 0.58
4 Belfast 333871 NaN 53584 186552 72428 6794 1040 484 7302 5687 16.05 55.88 21.69 2.03 0.31 0.14 2.19 1.70
5 Causeway Coast and Glens 140877 NaN 34111 83209 18680 1884 254 120 1828 791 24.21 59.06 13.26 1.34 0.18 0.09 1.30 0.56
6 Derry City and Strabane 147720 NaN 31256 55086 56642 2021 177 231 1327 980 21.16 37.29 38.34 1.37 0.12 0.16 0.90 0.66
7 Fermanagh and Omagh 113161 NaN 27950 50036 29937 1576 190 241 2698 533 24.70 44.22 26.46 1.39 0.17 0.21 2.38 0.47
8 Lisburn and Castlereagh 134841 NaN 18628 97014 12893 2618 449 144 1828 1267 13.81 71.95 9.56 1.94 0.33 0.11 1.36 0.94
9 Mid and East Antrim 135338 NaN 26575 96057 7545 1758 367 62 2304 670 19.64 70.98 5.57 1.30 0.27 0.05 1.70 0.50
10 Mid Ulster 138590 NaN 33351 61323 33916 2168 184 231 6834 583 24.06 44.25 24.47 1.56 0.13 0.17 4.93 0.42
11 Newry, Mourne and Down 171533 NaN 33062 76124 53330 3285 276 354 4113 989 19.27 44.38 31.09 1.92 0.16 0.21 2.40 0.58

In [ ]: