Nathan Butters commited on
Commit
05cd84e
1 Parent(s): 401217e

update app.py

Browse files
.DS_Store CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
 
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -1,6 +1,7 @@
1
  #Import the libraries we know we'll need for the Generator.
2
  import pandas as pd, spacy, nltk, numpy as np, re
3
  from spacy.matcher import Matcher
 
4
  nlp = spacy.load("en_core_web_lg")
5
  from nltk.corpus import wordnet
6
 
 
1
  #Import the libraries we know we'll need for the Generator.
2
  import pandas as pd, spacy, nltk, numpy as np, re
3
  from spacy.matcher import Matcher
4
+ !python -m spacy download en_core_web_lg
5
  nlp = spacy.load("en_core_web_lg")
6
  from nltk.corpus import wordnet
7
 
Assets/.DS_Store ADDED
Binary file (6.15 kB). View file
 
Assets/.ipynb_checkpoints/countries-checkpoint.csv ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Country,Continent
2
+ Algeria,Africa
3
+ Angola,Africa
4
+ Benin,Africa
5
+ Botswana,Africa
6
+ Burkina,Africa
7
+ Burundi,Africa
8
+ Cameroon,Africa
9
+ Cape Verde,Africa
10
+ Central African Republic,Africa
11
+ Chad,Africa
12
+ Comoros,Africa
13
+ Congo,Africa
14
+ "Congo, Democratic Republic of",Africa
15
+ Djibouti,Africa
16
+ Egypt,Africa
17
+ Equatorial Guinea,Africa
18
+ Eritrea,Africa
19
+ Ethiopia,Africa
20
+ Gabon,Africa
21
+ Gambia,Africa
22
+ Ghana,Africa
23
+ Guinea,Africa
24
+ Guinea-Bissau,Africa
25
+ Ivory Coast,Africa
26
+ Kenya,Africa
27
+ Lesotho,Africa
28
+ Liberia,Africa
29
+ Libya,Africa
30
+ Madagascar,Africa
31
+ Malawi,Africa
32
+ Mali,Africa
33
+ Mauritania,Africa
34
+ Mauritius,Africa
35
+ Morocco,Africa
36
+ Mozambique,Africa
37
+ Namibia,Africa
38
+ Niger,Africa
39
+ Nigeria,Africa
40
+ Rwanda,Africa
41
+ Sao Tome and Principe,Africa
42
+ Senegal,Africa
43
+ Seychelles,Africa
44
+ Sierra Leone,Africa
45
+ Somalia,Africa
46
+ South Africa,Africa
47
+ South Sudan,Africa
48
+ Sudan,Africa
49
+ Swaziland,Africa
50
+ Tanzania,Africa
51
+ Togo,Africa
52
+ Tunisia,Africa
53
+ Uganda,Africa
54
+ Zambia,Africa
55
+ Zimbabwe,Africa
56
+ Afghanistan,Asia
57
+ Bahrain,Asia
58
+ Bangladesh,Asia
59
+ Bhutan,Asia
60
+ Brunei,Asia
61
+ Burma (Myanmar),Asia
62
+ Cambodia,Asia
63
+ China,Asia
64
+ East Timor,Asia
65
+ India,Asia
66
+ Indonesia,Asia
67
+ Iran,Asia
68
+ Iraq,Asia
69
+ Israel,Asia
70
+ Japan,Asia
71
+ Jordan,Asia
72
+ Kazakhstan,Asia
73
+ "Korea, North",Asia
74
+ "Korea, South",Asia
75
+ Kuwait,Asia
76
+ Kyrgyzstan,Asia
77
+ Laos,Asia
78
+ Lebanon,Asia
79
+ Malaysia,Asia
80
+ Maldives,Asia
81
+ Mongolia,Asia
82
+ Nepal,Asia
83
+ Oman,Asia
84
+ Pakistan,Asia
85
+ Philippines,Asia
86
+ Qatar,Asia
87
+ Russian Federation,Asia
88
+ Saudi Arabia,Asia
89
+ Singapore,Asia
90
+ Sri Lanka,Asia
91
+ Syria,Asia
92
+ Tajikistan,Asia
93
+ Thailand,Asia
94
+ Turkey,Asia
95
+ Turkmenistan,Asia
96
+ United Arab Emirates,Asia
97
+ Uzbekistan,Asia
98
+ Vietnam,Asia
99
+ Yemen,Asia
100
+ Albania,Europe
101
+ Andorra,Europe
102
+ Armenia,Europe
103
+ Austria,Europe
104
+ Azerbaijan,Europe
105
+ Belarus,Europe
106
+ Belgium,Europe
107
+ Bosnia and Herzegovina,Europe
108
+ Bulgaria,Europe
109
+ Croatia,Europe
110
+ Cyprus,Europe
111
+ CZ,Europe
112
+ Denmark,Europe
113
+ Estonia,Europe
114
+ Finland,Europe
115
+ France,Europe
116
+ Georgia,Europe
117
+ Germany,Europe
118
+ Greece,Europe
119
+ Hungary,Europe
120
+ Iceland,Europe
121
+ Ireland,Europe
122
+ Italy,Europe
123
+ Latvia,Europe
124
+ Liechtenstein,Europe
125
+ Lithuania,Europe
126
+ Luxembourg,Europe
127
+ Macedonia,Europe
128
+ Malta,Europe
129
+ Moldova,Europe
130
+ Monaco,Europe
131
+ Montenegro,Europe
132
+ Netherlands,Europe
133
+ Norway,Europe
134
+ Poland,Europe
135
+ Portugal,Europe
136
+ Romania,Europe
137
+ San Marino,Europe
138
+ Serbia,Europe
139
+ Slovakia,Europe
140
+ Slovenia,Europe
141
+ Spain,Europe
142
+ Sweden,Europe
143
+ Switzerland,Europe
144
+ Ukraine,Europe
145
+ United Kingdom,Europe
146
+ Vatican City,Europe
147
+ Antigua and Barbuda,North America
148
+ Bahamas,North America
149
+ Barbados,North America
150
+ Belize,North America
151
+ Canada,North America
152
+ Costa Rica,North America
153
+ Cuba,North America
154
+ Dominica,North America
155
+ Dominican Republic,North America
156
+ El Salvador,North America
157
+ Grenada,North America
158
+ Guatemala,North America
159
+ Haiti,North America
160
+ Honduras,North America
161
+ Jamaica,North America
162
+ Mexico,North America
163
+ Nicaragua,North America
164
+ Panama,North America
165
+ Saint Kitts and Nevis,North America
166
+ Saint Lucia,North America
167
+ Saint Vincent and the Grenadines,North America
168
+ Trinidad and Tobago,North America
169
+ US,North America
170
+ Australia,Oceania
171
+ Fiji,Oceania
172
+ Kiribati,Oceania
173
+ Marshall Islands,Oceania
174
+ Micronesia,Oceania
175
+ Nauru,Oceania
176
+ New Zealand,Oceania
177
+ Palau,Oceania
178
+ Papua New Guinea,Oceania
179
+ Samoa,Oceania
180
+ Solomon Islands,Oceania
181
+ Tonga,Oceania
182
+ Tuvalu,Oceania
183
+ Vanuatu,Oceania
184
+ Argentina,South America
185
+ Bolivia,South America
186
+ Brazil,South America
187
+ Chile,South America
188
+ Colombia,South America
189
+ Ecuador,South America
190
+ Guyana,South America
191
+ Paraguay,South America
192
+ Peru,South America
193
+ Suriname,South America
194
+ Uruguay,South America
195
+ Venezuela,South America
Assets/Countries/.ipynb_checkpoints/Country-Data-Origin-checkpoint.md ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # Origin of the country data used in this project
2
+
3
+ I started by getting a list of countries on Github, from [
4
+ Daina Bouquin](https://github.com/dbouquin/IS_608/blob/master/NanosatDB_munging/Countries-Continents.csv), because it seemed relatively completey and contained continents. Then I started to think about secondary data that might be useful for exposing the bias in an algorithm and opted for the [World Happiness Report 2021](https://worldhappiness.report/ed/2021/#appendices-and-data). I added the continents to the countries in that file to ensure I could retain the initial categorization I used.
Assets/Countries/.ipynb_checkpoints/clean-countries-checkpoint.ipynb ADDED
@@ -0,0 +1,2273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "daf46b53-319f-4973-9bb6-664135dd328e",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import pandas as pd, spacy, nltk, numpy as np, re, ssl"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 56,
16
+ "id": "3cae7a11-7696-40fc-967e-7ecafcb2b0da",
17
+ "metadata": {},
18
+ "outputs": [],
19
+ "source": [
20
+ "df = pd.read_excel(\"Assets/Countries/DataPanelWHR2021C2.xls\")"
21
+ ]
22
+ },
23
+ {
24
+ "cell_type": "code",
25
+ "execution_count": 57,
26
+ "id": "c1ebf3f3-1d38-4919-b60a-dc15e7bf907b",
27
+ "metadata": {},
28
+ "outputs": [
29
+ {
30
+ "data": {
31
+ "text/html": [
32
+ "<div>\n",
33
+ "<style scoped>\n",
34
+ " .dataframe tbody tr th:only-of-type {\n",
35
+ " vertical-align: middle;\n",
36
+ " }\n",
37
+ "\n",
38
+ " .dataframe tbody tr th {\n",
39
+ " vertical-align: top;\n",
40
+ " }\n",
41
+ "\n",
42
+ " .dataframe thead th {\n",
43
+ " text-align: right;\n",
44
+ " }\n",
45
+ "</style>\n",
46
+ "<table border=\"1\" class=\"dataframe\">\n",
47
+ " <thead>\n",
48
+ " <tr style=\"text-align: right;\">\n",
49
+ " <th></th>\n",
50
+ " <th>Country</th>\n",
51
+ " <th>year</th>\n",
52
+ " <th>Life Ladder</th>\n",
53
+ " <th>Log GDP per capita</th>\n",
54
+ " <th>Social support</th>\n",
55
+ " <th>Healthy life expectancy at birth</th>\n",
56
+ " <th>Freedom to make life choices</th>\n",
57
+ " <th>Generosity</th>\n",
58
+ " <th>Perceptions of corruption</th>\n",
59
+ " <th>Positive affect</th>\n",
60
+ " <th>Negative affect</th>\n",
61
+ " </tr>\n",
62
+ " </thead>\n",
63
+ " <tbody>\n",
64
+ " <tr>\n",
65
+ " <th>0</th>\n",
66
+ " <td>Afghanistan</td>\n",
67
+ " <td>2008</td>\n",
68
+ " <td>3.723590</td>\n",
69
+ " <td>7.370100</td>\n",
70
+ " <td>0.450662</td>\n",
71
+ " <td>50.799999</td>\n",
72
+ " <td>0.718114</td>\n",
73
+ " <td>0.167640</td>\n",
74
+ " <td>0.881686</td>\n",
75
+ " <td>0.517637</td>\n",
76
+ " <td>0.258195</td>\n",
77
+ " </tr>\n",
78
+ " <tr>\n",
79
+ " <th>1</th>\n",
80
+ " <td>Afghanistan</td>\n",
81
+ " <td>2009</td>\n",
82
+ " <td>4.401778</td>\n",
83
+ " <td>7.539972</td>\n",
84
+ " <td>0.552308</td>\n",
85
+ " <td>51.200001</td>\n",
86
+ " <td>0.678896</td>\n",
87
+ " <td>0.190099</td>\n",
88
+ " <td>0.850035</td>\n",
89
+ " <td>0.583926</td>\n",
90
+ " <td>0.237092</td>\n",
91
+ " </tr>\n",
92
+ " <tr>\n",
93
+ " <th>2</th>\n",
94
+ " <td>Afghanistan</td>\n",
95
+ " <td>2010</td>\n",
96
+ " <td>4.758381</td>\n",
97
+ " <td>7.646709</td>\n",
98
+ " <td>0.539075</td>\n",
99
+ " <td>51.599998</td>\n",
100
+ " <td>0.600127</td>\n",
101
+ " <td>0.120590</td>\n",
102
+ " <td>0.706766</td>\n",
103
+ " <td>0.618265</td>\n",
104
+ " <td>0.275324</td>\n",
105
+ " </tr>\n",
106
+ " <tr>\n",
107
+ " <th>3</th>\n",
108
+ " <td>Afghanistan</td>\n",
109
+ " <td>2011</td>\n",
110
+ " <td>3.831719</td>\n",
111
+ " <td>7.619532</td>\n",
112
+ " <td>0.521104</td>\n",
113
+ " <td>51.919998</td>\n",
114
+ " <td>0.495901</td>\n",
115
+ " <td>0.162427</td>\n",
116
+ " <td>0.731109</td>\n",
117
+ " <td>0.611387</td>\n",
118
+ " <td>0.267175</td>\n",
119
+ " </tr>\n",
120
+ " <tr>\n",
121
+ " <th>4</th>\n",
122
+ " <td>Afghanistan</td>\n",
123
+ " <td>2012</td>\n",
124
+ " <td>3.782938</td>\n",
125
+ " <td>7.705479</td>\n",
126
+ " <td>0.520637</td>\n",
127
+ " <td>52.240002</td>\n",
128
+ " <td>0.530935</td>\n",
129
+ " <td>0.236032</td>\n",
130
+ " <td>0.775620</td>\n",
131
+ " <td>0.710385</td>\n",
132
+ " <td>0.267919</td>\n",
133
+ " </tr>\n",
134
+ " </tbody>\n",
135
+ "</table>\n",
136
+ "</div>"
137
+ ],
138
+ "text/plain": [
139
+ " Country year Life Ladder Log GDP per capita Social support \\\n",
140
+ "0 Afghanistan 2008 3.723590 7.370100 0.450662 \n",
141
+ "1 Afghanistan 2009 4.401778 7.539972 0.552308 \n",
142
+ "2 Afghanistan 2010 4.758381 7.646709 0.539075 \n",
143
+ "3 Afghanistan 2011 3.831719 7.619532 0.521104 \n",
144
+ "4 Afghanistan 2012 3.782938 7.705479 0.520637 \n",
145
+ "\n",
146
+ " Healthy life expectancy at birth Freedom to make life choices Generosity \\\n",
147
+ "0 50.799999 0.718114 0.167640 \n",
148
+ "1 51.200001 0.678896 0.190099 \n",
149
+ "2 51.599998 0.600127 0.120590 \n",
150
+ "3 51.919998 0.495901 0.162427 \n",
151
+ "4 52.240002 0.530935 0.236032 \n",
152
+ "\n",
153
+ " Perceptions of corruption Positive affect Negative affect \n",
154
+ "0 0.881686 0.517637 0.258195 \n",
155
+ "1 0.850035 0.583926 0.237092 \n",
156
+ "2 0.706766 0.618265 0.275324 \n",
157
+ "3 0.731109 0.611387 0.267175 \n",
158
+ "4 0.775620 0.710385 0.267919 "
159
+ ]
160
+ },
161
+ "execution_count": 57,
162
+ "metadata": {},
163
+ "output_type": "execute_result"
164
+ }
165
+ ],
166
+ "source": [
167
+ "df.head()"
168
+ ]
169
+ },
170
+ {
171
+ "cell_type": "code",
172
+ "execution_count": 59,
173
+ "id": "a1d054e6-8ca7-4675-913e-b0b500afe105",
174
+ "metadata": {},
175
+ "outputs": [],
176
+ "source": [
177
+ "df_sorted = df.sort_values(by=['year'], ascending = False)"
178
+ ]
179
+ },
180
+ {
181
+ "cell_type": "code",
182
+ "execution_count": 60,
183
+ "id": "42d08d97-fa68-40dc-9cfd-b0aa8acbb838",
184
+ "metadata": {},
185
+ "outputs": [
186
+ {
187
+ "data": {
188
+ "text/html": [
189
+ "<div>\n",
190
+ "<style scoped>\n",
191
+ " .dataframe tbody tr th:only-of-type {\n",
192
+ " vertical-align: middle;\n",
193
+ " }\n",
194
+ "\n",
195
+ " .dataframe tbody tr th {\n",
196
+ " vertical-align: top;\n",
197
+ " }\n",
198
+ "\n",
199
+ " .dataframe thead th {\n",
200
+ " text-align: right;\n",
201
+ " }\n",
202
+ "</style>\n",
203
+ "<table border=\"1\" class=\"dataframe\">\n",
204
+ " <thead>\n",
205
+ " <tr style=\"text-align: right;\">\n",
206
+ " <th></th>\n",
207
+ " <th>Country</th>\n",
208
+ " <th>year</th>\n",
209
+ " <th>Life Ladder</th>\n",
210
+ " <th>Log GDP per capita</th>\n",
211
+ " <th>Social support</th>\n",
212
+ " <th>Healthy life expectancy at birth</th>\n",
213
+ " <th>Freedom to make life choices</th>\n",
214
+ " <th>Generosity</th>\n",
215
+ " <th>Perceptions of corruption</th>\n",
216
+ " <th>Positive affect</th>\n",
217
+ " <th>Negative affect</th>\n",
218
+ " </tr>\n",
219
+ " </thead>\n",
220
+ " <tbody>\n",
221
+ " <tr>\n",
222
+ " <th>1948</th>\n",
223
+ " <td>Zimbabwe</td>\n",
224
+ " <td>2020</td>\n",
225
+ " <td>3.159802</td>\n",
226
+ " <td>7.828757</td>\n",
227
+ " <td>0.717243</td>\n",
228
+ " <td>56.799999</td>\n",
229
+ " <td>0.643303</td>\n",
230
+ " <td>-0.008696</td>\n",
231
+ " <td>0.788523</td>\n",
232
+ " <td>0.702573</td>\n",
233
+ " <td>0.345736</td>\n",
234
+ " </tr>\n",
235
+ " <tr>\n",
236
+ " <th>174</th>\n",
237
+ " <td>Benin</td>\n",
238
+ " <td>2020</td>\n",
239
+ " <td>4.407746</td>\n",
240
+ " <td>8.102292</td>\n",
241
+ " <td>0.506636</td>\n",
242
+ " <td>55.099998</td>\n",
243
+ " <td>0.783115</td>\n",
244
+ " <td>-0.083489</td>\n",
245
+ " <td>0.531884</td>\n",
246
+ " <td>0.608585</td>\n",
247
+ " <td>0.304512</td>\n",
248
+ " </tr>\n",
249
+ " <tr>\n",
250
+ " <th>1835</th>\n",
251
+ " <td>United Kingdom</td>\n",
252
+ " <td>2020</td>\n",
253
+ " <td>6.798177</td>\n",
254
+ " <td>10.625811</td>\n",
255
+ " <td>0.929353</td>\n",
256
+ " <td>72.699997</td>\n",
257
+ " <td>0.884624</td>\n",
258
+ " <td>0.202508</td>\n",
259
+ " <td>0.490204</td>\n",
260
+ " <td>0.758164</td>\n",
261
+ " <td>0.224655</td>\n",
262
+ " </tr>\n",
263
+ " <tr>\n",
264
+ " <th>1394</th>\n",
265
+ " <td>Philippines</td>\n",
266
+ " <td>2020</td>\n",
267
+ " <td>5.079585</td>\n",
268
+ " <td>9.061443</td>\n",
269
+ " <td>0.781140</td>\n",
270
+ " <td>62.099998</td>\n",
271
+ " <td>0.932042</td>\n",
272
+ " <td>-0.115543</td>\n",
273
+ " <td>0.744284</td>\n",
274
+ " <td>0.803562</td>\n",
275
+ " <td>0.326889</td>\n",
276
+ " </tr>\n",
277
+ " <tr>\n",
278
+ " <th>785</th>\n",
279
+ " <td>Iraq</td>\n",
280
+ " <td>2020</td>\n",
281
+ " <td>4.785165</td>\n",
282
+ " <td>9.167186</td>\n",
283
+ " <td>0.707847</td>\n",
284
+ " <td>61.400002</td>\n",
285
+ " <td>0.700215</td>\n",
286
+ " <td>-0.020748</td>\n",
287
+ " <td>0.849109</td>\n",
288
+ " <td>0.644464</td>\n",
289
+ " <td>0.531539</td>\n",
290
+ " </tr>\n",
291
+ " </tbody>\n",
292
+ "</table>\n",
293
+ "</div>"
294
+ ],
295
+ "text/plain": [
296
+ " Country year Life Ladder Log GDP per capita Social support \\\n",
297
+ "1948 Zimbabwe 2020 3.159802 7.828757 0.717243 \n",
298
+ "174 Benin 2020 4.407746 8.102292 0.506636 \n",
299
+ "1835 United Kingdom 2020 6.798177 10.625811 0.929353 \n",
300
+ "1394 Philippines 2020 5.079585 9.061443 0.781140 \n",
301
+ "785 Iraq 2020 4.785165 9.167186 0.707847 \n",
302
+ "\n",
303
+ " Healthy life expectancy at birth Freedom to make life choices \\\n",
304
+ "1948 56.799999 0.643303 \n",
305
+ "174 55.099998 0.783115 \n",
306
+ "1835 72.699997 0.884624 \n",
307
+ "1394 62.099998 0.932042 \n",
308
+ "785 61.400002 0.700215 \n",
309
+ "\n",
310
+ " Generosity Perceptions of corruption Positive affect Negative affect \n",
311
+ "1948 -0.008696 0.788523 0.702573 0.345736 \n",
312
+ "174 -0.083489 0.531884 0.608585 0.304512 \n",
313
+ "1835 0.202508 0.490204 0.758164 0.224655 \n",
314
+ "1394 -0.115543 0.744284 0.803562 0.326889 \n",
315
+ "785 -0.020748 0.849109 0.644464 0.531539 "
316
+ ]
317
+ },
318
+ "execution_count": 60,
319
+ "metadata": {},
320
+ "output_type": "execute_result"
321
+ }
322
+ ],
323
+ "source": [
324
+ "df_sorted.head()"
325
+ ]
326
+ },
327
+ {
328
+ "cell_type": "code",
329
+ "execution_count": 61,
330
+ "id": "abb8954c-106f-42d1-bf2a-0200b8927306",
331
+ "metadata": {},
332
+ "outputs": [],
333
+ "source": [
334
+ "df_dedup = df_sorted.drop_duplicates(subset=['Country'])"
335
+ ]
336
+ },
337
+ {
338
+ "cell_type": "code",
339
+ "execution_count": 62,
340
+ "id": "969f5fcf-5dc6-4ce3-93f7-0f35473f3c73",
341
+ "metadata": {},
342
+ "outputs": [
343
+ {
344
+ "data": {
345
+ "text/html": [
346
+ "<div>\n",
347
+ "<style scoped>\n",
348
+ " .dataframe tbody tr th:only-of-type {\n",
349
+ " vertical-align: middle;\n",
350
+ " }\n",
351
+ "\n",
352
+ " .dataframe tbody tr th {\n",
353
+ " vertical-align: top;\n",
354
+ " }\n",
355
+ "\n",
356
+ " .dataframe thead th {\n",
357
+ " text-align: right;\n",
358
+ " }\n",
359
+ "</style>\n",
360
+ "<table border=\"1\" class=\"dataframe\">\n",
361
+ " <thead>\n",
362
+ " <tr style=\"text-align: right;\">\n",
363
+ " <th></th>\n",
364
+ " <th>Country</th>\n",
365
+ " <th>year</th>\n",
366
+ " <th>Life Ladder</th>\n",
367
+ " <th>Log GDP per capita</th>\n",
368
+ " <th>Social support</th>\n",
369
+ " <th>Healthy life expectancy at birth</th>\n",
370
+ " <th>Freedom to make life choices</th>\n",
371
+ " <th>Generosity</th>\n",
372
+ " <th>Perceptions of corruption</th>\n",
373
+ " <th>Positive affect</th>\n",
374
+ " <th>Negative affect</th>\n",
375
+ " </tr>\n",
376
+ " </thead>\n",
377
+ " <tbody>\n",
378
+ " <tr>\n",
379
+ " <th>1948</th>\n",
380
+ " <td>Zimbabwe</td>\n",
381
+ " <td>2020</td>\n",
382
+ " <td>3.159802</td>\n",
383
+ " <td>7.828757</td>\n",
384
+ " <td>0.717243</td>\n",
385
+ " <td>56.799999</td>\n",
386
+ " <td>0.643303</td>\n",
387
+ " <td>-0.008696</td>\n",
388
+ " <td>0.788523</td>\n",
389
+ " <td>0.702573</td>\n",
390
+ " <td>0.345736</td>\n",
391
+ " </tr>\n",
392
+ " <tr>\n",
393
+ " <th>174</th>\n",
394
+ " <td>Benin</td>\n",
395
+ " <td>2020</td>\n",
396
+ " <td>4.407746</td>\n",
397
+ " <td>8.102292</td>\n",
398
+ " <td>0.506636</td>\n",
399
+ " <td>55.099998</td>\n",
400
+ " <td>0.783115</td>\n",
401
+ " <td>-0.083489</td>\n",
402
+ " <td>0.531884</td>\n",
403
+ " <td>0.608585</td>\n",
404
+ " <td>0.304512</td>\n",
405
+ " </tr>\n",
406
+ " <tr>\n",
407
+ " <th>1835</th>\n",
408
+ " <td>United Kingdom</td>\n",
409
+ " <td>2020</td>\n",
410
+ " <td>6.798177</td>\n",
411
+ " <td>10.625811</td>\n",
412
+ " <td>0.929353</td>\n",
413
+ " <td>72.699997</td>\n",
414
+ " <td>0.884624</td>\n",
415
+ " <td>0.202508</td>\n",
416
+ " <td>0.490204</td>\n",
417
+ " <td>0.758164</td>\n",
418
+ " <td>0.224655</td>\n",
419
+ " </tr>\n",
420
+ " <tr>\n",
421
+ " <th>1394</th>\n",
422
+ " <td>Philippines</td>\n",
423
+ " <td>2020</td>\n",
424
+ " <td>5.079585</td>\n",
425
+ " <td>9.061443</td>\n",
426
+ " <td>0.781140</td>\n",
427
+ " <td>62.099998</td>\n",
428
+ " <td>0.932042</td>\n",
429
+ " <td>-0.115543</td>\n",
430
+ " <td>0.744284</td>\n",
431
+ " <td>0.803562</td>\n",
432
+ " <td>0.326889</td>\n",
433
+ " </tr>\n",
434
+ " <tr>\n",
435
+ " <th>785</th>\n",
436
+ " <td>Iraq</td>\n",
437
+ " <td>2020</td>\n",
438
+ " <td>4.785165</td>\n",
439
+ " <td>9.167186</td>\n",
440
+ " <td>0.707847</td>\n",
441
+ " <td>61.400002</td>\n",
442
+ " <td>0.700215</td>\n",
443
+ " <td>-0.020748</td>\n",
444
+ " <td>0.849109</td>\n",
445
+ " <td>0.644464</td>\n",
446
+ " <td>0.531539</td>\n",
447
+ " </tr>\n",
448
+ " </tbody>\n",
449
+ "</table>\n",
450
+ "</div>"
451
+ ],
452
+ "text/plain": [
453
+ " Country year Life Ladder Log GDP per capita Social support \\\n",
454
+ "1948 Zimbabwe 2020 3.159802 7.828757 0.717243 \n",
455
+ "174 Benin 2020 4.407746 8.102292 0.506636 \n",
456
+ "1835 United Kingdom 2020 6.798177 10.625811 0.929353 \n",
457
+ "1394 Philippines 2020 5.079585 9.061443 0.781140 \n",
458
+ "785 Iraq 2020 4.785165 9.167186 0.707847 \n",
459
+ "\n",
460
+ " Healthy life expectancy at birth Freedom to make life choices \\\n",
461
+ "1948 56.799999 0.643303 \n",
462
+ "174 55.099998 0.783115 \n",
463
+ "1835 72.699997 0.884624 \n",
464
+ "1394 62.099998 0.932042 \n",
465
+ "785 61.400002 0.700215 \n",
466
+ "\n",
467
+ " Generosity Perceptions of corruption Positive affect Negative affect \n",
468
+ "1948 -0.008696 0.788523 0.702573 0.345736 \n",
469
+ "174 -0.083489 0.531884 0.608585 0.304512 \n",
470
+ "1835 0.202508 0.490204 0.758164 0.224655 \n",
471
+ "1394 -0.115543 0.744284 0.803562 0.326889 \n",
472
+ "785 -0.020748 0.849109 0.644464 0.531539 "
473
+ ]
474
+ },
475
+ "execution_count": 62,
476
+ "metadata": {},
477
+ "output_type": "execute_result"
478
+ }
479
+ ],
480
+ "source": [
481
+ "df_dedup.head()"
482
+ ]
483
+ },
484
+ {
485
+ "cell_type": "code",
486
+ "execution_count": 63,
487
+ "id": "d080546c-4698-4edd-8b76-e3c94aee9862",
488
+ "metadata": {},
489
+ "outputs": [
490
+ {
491
+ "data": {
492
+ "text/plain": [
493
+ "1949"
494
+ ]
495
+ },
496
+ "execution_count": 63,
497
+ "metadata": {},
498
+ "output_type": "execute_result"
499
+ }
500
+ ],
501
+ "source": [
502
+ "len(df_sorted)"
503
+ ]
504
+ },
505
+ {
506
+ "cell_type": "code",
507
+ "execution_count": 64,
508
+ "id": "6a817f5c-e871-4d69-9368-00a90efc6007",
509
+ "metadata": {},
510
+ "outputs": [
511
+ {
512
+ "data": {
513
+ "text/plain": [
514
+ "166"
515
+ ]
516
+ },
517
+ "execution_count": 64,
518
+ "metadata": {},
519
+ "output_type": "execute_result"
520
+ }
521
+ ],
522
+ "source": [
523
+ "len(df_dedup)"
524
+ ]
525
+ },
526
+ {
527
+ "cell_type": "code",
528
+ "execution_count": 65,
529
+ "id": "d6640a42-064e-4b31-b89d-de4f7d4240a3",
530
+ "metadata": {},
531
+ "outputs": [
532
+ {
533
+ "data": {
534
+ "text/html": [
535
+ "<div>\n",
536
+ "<style scoped>\n",
537
+ " .dataframe tbody tr th:only-of-type {\n",
538
+ " vertical-align: middle;\n",
539
+ " }\n",
540
+ "\n",
541
+ " .dataframe tbody tr th {\n",
542
+ " vertical-align: top;\n",
543
+ " }\n",
544
+ "\n",
545
+ " .dataframe thead th {\n",
546
+ " text-align: right;\n",
547
+ " }\n",
548
+ "</style>\n",
549
+ "<table border=\"1\" class=\"dataframe\">\n",
550
+ " <thead>\n",
551
+ " <tr style=\"text-align: right;\">\n",
552
+ " <th></th>\n",
553
+ " <th>Country</th>\n",
554
+ " <th>Continent</th>\n",
555
+ " </tr>\n",
556
+ " </thead>\n",
557
+ " <tbody>\n",
558
+ " <tr>\n",
559
+ " <th>0</th>\n",
560
+ " <td>Algeria</td>\n",
561
+ " <td>Africa</td>\n",
562
+ " </tr>\n",
563
+ " <tr>\n",
564
+ " <th>1</th>\n",
565
+ " <td>Angola</td>\n",
566
+ " <td>Africa</td>\n",
567
+ " </tr>\n",
568
+ " <tr>\n",
569
+ " <th>2</th>\n",
570
+ " <td>Benin</td>\n",
571
+ " <td>Africa</td>\n",
572
+ " </tr>\n",
573
+ " <tr>\n",
574
+ " <th>3</th>\n",
575
+ " <td>Botswana</td>\n",
576
+ " <td>Africa</td>\n",
577
+ " </tr>\n",
578
+ " <tr>\n",
579
+ " <th>4</th>\n",
580
+ " <td>Burkina</td>\n",
581
+ " <td>Africa</td>\n",
582
+ " </tr>\n",
583
+ " </tbody>\n",
584
+ "</table>\n",
585
+ "</div>"
586
+ ],
587
+ "text/plain": [
588
+ " Country Continent\n",
589
+ "0 Algeria Africa\n",
590
+ "1 Angola Africa\n",
591
+ "2 Benin Africa\n",
592
+ "3 Botswana Africa\n",
593
+ "4 Burkina Africa"
594
+ ]
595
+ },
596
+ "execution_count": 65,
597
+ "metadata": {},
598
+ "output_type": "execute_result"
599
+ }
600
+ ],
601
+ "source": [
602
+ "df_csv = pd.read_csv(\"Assets/Countries/countries.csv\")\n",
603
+ "df_csv.head()"
604
+ ]
605
+ },
606
+ {
607
+ "cell_type": "code",
608
+ "execution_count": 18,
609
+ "id": "a6e6f52e-cff7-4d78-b630-e71e07fa8842",
610
+ "metadata": {},
611
+ "outputs": [
612
+ {
613
+ "data": {
614
+ "text/plain": [
615
+ "194"
616
+ ]
617
+ },
618
+ "execution_count": 18,
619
+ "metadata": {},
620
+ "output_type": "execute_result"
621
+ }
622
+ ],
623
+ "source": [
624
+ "len(df_csv)"
625
+ ]
626
+ },
627
+ {
628
+ "cell_type": "code",
629
+ "execution_count": 66,
630
+ "id": "edaae740-75bf-42a2-afa6-ebbbbf50d792",
631
+ "metadata": {},
632
+ "outputs": [],
633
+ "source": [
634
+ "c1 = df_dedup[\"Country\"]\n",
635
+ "c2 = list(df_csv[\"Country\"])\n",
636
+ "c3 = [(country, country in c2) for country in c1]"
637
+ ]
638
+ },
639
+ {
640
+ "cell_type": "code",
641
+ "execution_count": 67,
642
+ "id": "5e86b02e-e5a3-4eaf-b045-74f0d0cfea08",
643
+ "metadata": {},
644
+ "outputs": [
645
+ {
646
+ "data": {
647
+ "text/plain": [
648
+ "True"
649
+ ]
650
+ },
651
+ "execution_count": 67,
652
+ "metadata": {},
653
+ "output_type": "execute_result"
654
+ }
655
+ ],
656
+ "source": [
657
+ "\"Zimbabwe\" in c2"
658
+ ]
659
+ },
660
+ {
661
+ "cell_type": "code",
662
+ "execution_count": 68,
663
+ "id": "921765a7-6f40-4d6a-9403-f5f8d8f26a65",
664
+ "metadata": {},
665
+ "outputs": [
666
+ {
667
+ "data": {
668
+ "text/plain": [
669
+ "[('Zimbabwe', True),\n",
670
+ " ('Benin', True),\n",
671
+ " ('United Kingdom', True),\n",
672
+ " ('Philippines', True),\n",
673
+ " ('Iraq', True),\n",
674
+ " ('Belgium', True),\n",
675
+ " ('Iran', True),\n",
676
+ " ('Poland', True),\n",
677
+ " ('Portugal', True),\n",
678
+ " ('India', True),\n",
679
+ " ('Israel', True),\n",
680
+ " ('Iceland', True),\n",
681
+ " ('United Arab Emirates', True),\n",
682
+ " ('Hungary', True),\n",
683
+ " ('Hong Kong S.A.R. of China', False),\n",
684
+ " ('Bolivia', True),\n",
685
+ " ('Russia', False),\n",
686
+ " ('Saudi Arabia', True),\n",
687
+ " ('Ireland', True),\n",
688
+ " ('Italy', True),\n",
689
+ " ('Ukraine', True),\n",
690
+ " ('Kenya', True),\n",
691
+ " ('Latvia', True),\n",
692
+ " ('Laos', True),\n",
693
+ " ('Nigeria', True),\n",
694
+ " ('Austria', True),\n",
695
+ " ('Kyrgyzstan', True),\n",
696
+ " ('North Macedonia', False),\n",
697
+ " ('Kosovo', False),\n",
698
+ " ('Norway', True),\n",
699
+ " ('United States', False),\n",
700
+ " ('Kazakhstan', True),\n",
701
+ " ('Bahrain', True),\n",
702
+ " ('Uruguay', True),\n",
703
+ " ('Jordan', True),\n",
704
+ " ('Japan', True),\n",
705
+ " ('Bangladesh', True),\n",
706
+ " ('Ivory Coast', True),\n",
707
+ " ('Bosnia and Herzegovina', True),\n",
708
+ " ('Greece', True),\n",
709
+ " ('Australia', True),\n",
710
+ " ('Croatia', True),\n",
711
+ " ('Tunisia', True),\n",
712
+ " ('Spain', True),\n",
713
+ " ('Denmark', True),\n",
714
+ " ('Cameroon', True),\n",
715
+ " ('Czech Republic', False),\n",
716
+ " ('Cyprus', True),\n",
717
+ " ('Sweden', True),\n",
718
+ " ('Canada', True),\n",
719
+ " ('South Korea', False),\n",
720
+ " ('Switzerland', True),\n",
721
+ " ('Thailand', True),\n",
722
+ " ('Taiwan Province of China', False),\n",
723
+ " ('Colombia', True),\n",
724
+ " ('Tajikistan', True),\n",
725
+ " ('Tanzania', True),\n",
726
+ " ('China', True),\n",
727
+ " ('Dominican Republic', True),\n",
728
+ " ('Cambodia', True),\n",
729
+ " ('Ghana', True),\n",
730
+ " ('Slovakia', True),\n",
731
+ " ('Serbia', True),\n",
732
+ " ('Uganda', True),\n",
733
+ " ('Germany', True),\n",
734
+ " ('Georgia', True),\n",
735
+ " ('Brazil', True),\n",
736
+ " ('France', True),\n",
737
+ " ('Bulgaria', True),\n",
738
+ " ('Finland', True),\n",
739
+ " ('Ecuador', True),\n",
740
+ " ('Ethiopia', True),\n",
741
+ " ('Slovenia', True),\n",
742
+ " ('Estonia', True),\n",
743
+ " ('El Salvador', True),\n",
744
+ " ('Turkey', True),\n",
745
+ " ('South Africa', True),\n",
746
+ " ('Egypt', True),\n",
747
+ " ('Venezuela', True),\n",
748
+ " ('Chile', True),\n",
749
+ " ('Lithuania', True),\n",
750
+ " ('Moldova', True),\n",
751
+ " ('Netherlands', True),\n",
752
+ " ('Mongolia', True),\n",
753
+ " ('Mauritius', True),\n",
754
+ " ('Mexico', True),\n",
755
+ " ('New Zealand', True),\n",
756
+ " ('Namibia', True),\n",
757
+ " ('Myanmar', False),\n",
758
+ " ('Malta', True),\n",
759
+ " ('Zambia', True),\n",
760
+ " ('Argentina', True),\n",
761
+ " ('Morocco', True),\n",
762
+ " ('Albania', True),\n",
763
+ " ('Montenegro', True),\n",
764
+ " ('Guinea', True),\n",
765
+ " ('Yemen', True),\n",
766
+ " ('Guatemala', True),\n",
767
+ " ('Malaysia', True),\n",
768
+ " ('Rwanda', True),\n",
769
+ " ('Sri Lanka', True),\n",
770
+ " ('Malawi', True),\n",
771
+ " ('Nepal', True),\n",
772
+ " ('Swaziland', True),\n",
773
+ " ('Romania', True),\n",
774
+ " ('Senegal', True),\n",
775
+ " ('Honduras', True),\n",
776
+ " ('Mali', True),\n",
777
+ " ('Mauritania', True),\n",
778
+ " ('Turkmenistan', True),\n",
779
+ " ('Burkina Faso', False),\n",
780
+ " ('Algeria', True),\n",
781
+ " ('Botswana', True),\n",
782
+ " ('Sierra Leone', True),\n",
783
+ " ('Mozambique', True),\n",
784
+ " ('Singapore', True),\n",
785
+ " ('Gambia', True),\n",
786
+ " ('Gabon', True),\n",
787
+ " ('Indonesia', True),\n",
788
+ " ('Azerbaijan', True),\n",
789
+ " ('Chad', True),\n",
790
+ " ('Liberia', True),\n",
791
+ " ('Libya', True),\n",
792
+ " ('Pakistan', True),\n",
793
+ " ('Armenia', True),\n",
794
+ " ('Comoros', True),\n",
795
+ " ('Afghanistan', True),\n",
796
+ " ('Palestinian Territories', False),\n",
797
+ " ('Nicaragua', True),\n",
798
+ " ('Niger', True),\n",
799
+ " ('Lebanon', True),\n",
800
+ " ('Lesotho', True),\n",
801
+ " ('Uzbekistan', True),\n",
802
+ " ('North Cyprus', False),\n",
803
+ " ('Kuwait', True),\n",
804
+ " ('Congo (Brazzaville)', False),\n",
805
+ " ('Peru', True),\n",
806
+ " ('Vietnam', True),\n",
807
+ " ('Togo', True),\n",
808
+ " ('Belarus', True),\n",
809
+ " ('Madagascar', True),\n",
810
+ " ('Costa Rica', True),\n",
811
+ " ('Luxembourg', True),\n",
812
+ " ('Panama', True),\n",
813
+ " ('Paraguay', True),\n",
814
+ " ('Jamaica', True),\n",
815
+ " ('Maldives', True),\n",
816
+ " ('Haiti', True),\n",
817
+ " ('Burundi', True),\n",
818
+ " ('Congo (Kinshasa)', False),\n",
819
+ " ('Central African Republic', True),\n",
820
+ " ('Trinidad and Tobago', True),\n",
821
+ " ('South Sudan', True),\n",
822
+ " ('Somalia', True),\n",
823
+ " ('Syria', True),\n",
824
+ " ('Qatar', True),\n",
825
+ " ('Bhutan', True),\n",
826
+ " ('Sudan', True),\n",
827
+ " ('Angola', True),\n",
828
+ " ('Belize', True),\n",
829
+ " ('Suriname', True),\n",
830
+ " ('Somaliland region', False),\n",
831
+ " ('Oman', True),\n",
832
+ " ('Djibouti', True),\n",
833
+ " ('Guyana', True),\n",
834
+ " ('Cuba', True)]"
835
+ ]
836
+ },
837
+ "execution_count": 68,
838
+ "metadata": {},
839
+ "output_type": "execute_result"
840
+ }
841
+ ],
842
+ "source": [
843
+ "c3"
844
+ ]
845
+ },
846
+ {
847
+ "cell_type": "code",
848
+ "execution_count": 37,
849
+ "id": "ff74b057-7281-4ab2-82c5-367e949fbbed",
850
+ "metadata": {},
851
+ "outputs": [
852
+ {
853
+ "data": {
854
+ "text/plain": [
855
+ "['Hong Kong S.A.R. of China',\n",
856
+ " 'Russia',\n",
857
+ " 'North Macedonia',\n",
858
+ " 'Kosovo',\n",
859
+ " 'United States',\n",
860
+ " 'Czech Republic',\n",
861
+ " 'South Korea',\n",
862
+ " 'Taiwan Province of China',\n",
863
+ " 'Myanmar',\n",
864
+ " 'Burkina Faso',\n",
865
+ " 'Palestinian Territories',\n",
866
+ " 'North Cyprus',\n",
867
+ " 'Congo (Brazzaville)',\n",
868
+ " 'Congo (Kinshasa)',\n",
869
+ " 'Somaliland region']"
870
+ ]
871
+ },
872
+ "execution_count": 37,
873
+ "metadata": {},
874
+ "output_type": "execute_result"
875
+ }
876
+ ],
877
+ "source": [
878
+ "num = 0\n",
879
+ "missing = []\n",
880
+ "for pair in c3:\n",
881
+ " if pair[1]:\n",
882
+ " num +=1\n",
883
+ " else:\n",
884
+ " missing.append(pair[0]) \n",
885
+ "num\n",
886
+ "missing"
887
+ ]
888
+ },
889
+ {
890
+ "cell_type": "code",
891
+ "execution_count": 44,
892
+ "id": "50f20260-3ed6-4f4e-a558-e3c6374ecb26",
893
+ "metadata": {},
894
+ "outputs": [
895
+ {
896
+ "data": {
897
+ "text/plain": [
898
+ "'Africa'"
899
+ ]
900
+ },
901
+ "execution_count": 44,
902
+ "metadata": {},
903
+ "output_type": "execute_result"
904
+ }
905
+ ],
906
+ "source": [
907
+ "df_csv.loc[df_csv['Country'] == \"Madagascar\", 'Continent'].iloc[0]"
908
+ ]
909
+ },
910
+ {
911
+ "cell_type": "code",
912
+ "execution_count": 50,
913
+ "id": "9dfa66ef-1c2b-4893-8993-107c2e02a2c8",
914
+ "metadata": {},
915
+ "outputs": [
916
+ {
917
+ "data": {
918
+ "text/html": [
919
+ "<div>\n",
920
+ "<style scoped>\n",
921
+ " .dataframe tbody tr th:only-of-type {\n",
922
+ " vertical-align: middle;\n",
923
+ " }\n",
924
+ "\n",
925
+ " .dataframe tbody tr th {\n",
926
+ " vertical-align: top;\n",
927
+ " }\n",
928
+ "\n",
929
+ " .dataframe thead th {\n",
930
+ " text-align: right;\n",
931
+ " }\n",
932
+ "</style>\n",
933
+ "<table border=\"1\" class=\"dataframe\">\n",
934
+ " <thead>\n",
935
+ " <tr style=\"text-align: right;\">\n",
936
+ " <th></th>\n",
937
+ " <th>Country name</th>\n",
938
+ " <th>year</th>\n",
939
+ " <th>Life Ladder</th>\n",
940
+ " <th>Log GDP per capita</th>\n",
941
+ " <th>Social support</th>\n",
942
+ " <th>Healthy life expectancy at birth</th>\n",
943
+ " <th>Freedom to make life choices</th>\n",
944
+ " <th>Generosity</th>\n",
945
+ " <th>Perceptions of corruption</th>\n",
946
+ " <th>Positive affect</th>\n",
947
+ " <th>Negative affect</th>\n",
948
+ " <th>Continent</th>\n",
949
+ " </tr>\n",
950
+ " </thead>\n",
951
+ " <tbody>\n",
952
+ " <tr>\n",
953
+ " <th>1948</th>\n",
954
+ " <td>Zimbabwe</td>\n",
955
+ " <td>2020</td>\n",
956
+ " <td>3.159802</td>\n",
957
+ " <td>7.828757</td>\n",
958
+ " <td>0.717243</td>\n",
959
+ " <td>56.799999</td>\n",
960
+ " <td>0.643303</td>\n",
961
+ " <td>-0.008696</td>\n",
962
+ " <td>0.788523</td>\n",
963
+ " <td>0.702573</td>\n",
964
+ " <td>0.345736</td>\n",
965
+ " <td>&lt;pandas.core.indexing._iLocIndexer object at 0...</td>\n",
966
+ " </tr>\n",
967
+ " <tr>\n",
968
+ " <th>174</th>\n",
969
+ " <td>Benin</td>\n",
970
+ " <td>2020</td>\n",
971
+ " <td>4.407746</td>\n",
972
+ " <td>8.102292</td>\n",
973
+ " <td>0.506636</td>\n",
974
+ " <td>55.099998</td>\n",
975
+ " <td>0.783115</td>\n",
976
+ " <td>-0.083489</td>\n",
977
+ " <td>0.531884</td>\n",
978
+ " <td>0.608585</td>\n",
979
+ " <td>0.304512</td>\n",
980
+ " <td>&lt;pandas.core.indexing._iLocIndexer object at 0...</td>\n",
981
+ " </tr>\n",
982
+ " <tr>\n",
983
+ " <th>1835</th>\n",
984
+ " <td>United Kingdom</td>\n",
985
+ " <td>2020</td>\n",
986
+ " <td>6.798177</td>\n",
987
+ " <td>10.625811</td>\n",
988
+ " <td>0.929353</td>\n",
989
+ " <td>72.699997</td>\n",
990
+ " <td>0.884624</td>\n",
991
+ " <td>0.202508</td>\n",
992
+ " <td>0.490204</td>\n",
993
+ " <td>0.758164</td>\n",
994
+ " <td>0.224655</td>\n",
995
+ " <td>&lt;pandas.core.indexing._iLocIndexer object at 0...</td>\n",
996
+ " </tr>\n",
997
+ " <tr>\n",
998
+ " <th>1394</th>\n",
999
+ " <td>Philippines</td>\n",
1000
+ " <td>2020</td>\n",
1001
+ " <td>5.079585</td>\n",
1002
+ " <td>9.061443</td>\n",
1003
+ " <td>0.781140</td>\n",
1004
+ " <td>62.099998</td>\n",
1005
+ " <td>0.932042</td>\n",
1006
+ " <td>-0.115543</td>\n",
1007
+ " <td>0.744284</td>\n",
1008
+ " <td>0.803562</td>\n",
1009
+ " <td>0.326889</td>\n",
1010
+ " <td>&lt;pandas.core.indexing._iLocIndexer object at 0...</td>\n",
1011
+ " </tr>\n",
1012
+ " <tr>\n",
1013
+ " <th>785</th>\n",
1014
+ " <td>Iraq</td>\n",
1015
+ " <td>2020</td>\n",
1016
+ " <td>4.785165</td>\n",
1017
+ " <td>9.167186</td>\n",
1018
+ " <td>0.707847</td>\n",
1019
+ " <td>61.400002</td>\n",
1020
+ " <td>0.700215</td>\n",
1021
+ " <td>-0.020748</td>\n",
1022
+ " <td>0.849109</td>\n",
1023
+ " <td>0.644464</td>\n",
1024
+ " <td>0.531539</td>\n",
1025
+ " <td>&lt;pandas.core.indexing._iLocIndexer object at 0...</td>\n",
1026
+ " </tr>\n",
1027
+ " </tbody>\n",
1028
+ "</table>\n",
1029
+ "</div>"
1030
+ ],
1031
+ "text/plain": [
1032
+ " Country name year Life Ladder Log GDP per capita Social support \\\n",
1033
+ "1948 Zimbabwe 2020 3.159802 7.828757 0.717243 \n",
1034
+ "174 Benin 2020 4.407746 8.102292 0.506636 \n",
1035
+ "1835 United Kingdom 2020 6.798177 10.625811 0.929353 \n",
1036
+ "1394 Philippines 2020 5.079585 9.061443 0.781140 \n",
1037
+ "785 Iraq 2020 4.785165 9.167186 0.707847 \n",
1038
+ "\n",
1039
+ " Healthy life expectancy at birth Freedom to make life choices \\\n",
1040
+ "1948 56.799999 0.643303 \n",
1041
+ "174 55.099998 0.783115 \n",
1042
+ "1835 72.699997 0.884624 \n",
1043
+ "1394 62.099998 0.932042 \n",
1044
+ "785 61.400002 0.700215 \n",
1045
+ "\n",
1046
+ " Generosity Perceptions of corruption Positive affect Negative affect \\\n",
1047
+ "1948 -0.008696 0.788523 0.702573 0.345736 \n",
1048
+ "174 -0.083489 0.531884 0.608585 0.304512 \n",
1049
+ "1835 0.202508 0.490204 0.758164 0.224655 \n",
1050
+ "1394 -0.115543 0.744284 0.803562 0.326889 \n",
1051
+ "785 -0.020748 0.849109 0.644464 0.531539 \n",
1052
+ "\n",
1053
+ " Continent \n",
1054
+ "1948 <pandas.core.indexing._iLocIndexer object at 0... \n",
1055
+ "174 <pandas.core.indexing._iLocIndexer object at 0... \n",
1056
+ "1835 <pandas.core.indexing._iLocIndexer object at 0... \n",
1057
+ "1394 <pandas.core.indexing._iLocIndexer object at 0... \n",
1058
+ "785 <pandas.core.indexing._iLocIndexer object at 0... "
1059
+ ]
1060
+ },
1061
+ "execution_count": 50,
1062
+ "metadata": {},
1063
+ "output_type": "execute_result"
1064
+ }
1065
+ ],
1066
+ "source": [
1067
+ "df_dedup.head()"
1068
+ ]
1069
+ },
1070
+ {
1071
+ "cell_type": "code",
1072
+ "execution_count": 74,
1073
+ "id": "b1fcd392-abfb-42a8-8485-f3fbd6a155d1",
1074
+ "metadata": {},
1075
+ "outputs": [],
1076
+ "source": [
1077
+ "df_cont = df_dedup.set_index('Country').join(df_csv.set_index('Country'), on='Country', how='left')"
1078
+ ]
1079
+ },
1080
+ {
1081
+ "cell_type": "code",
1082
+ "execution_count": 77,
1083
+ "id": "55ec121c-534e-4e25-88e9-5ab8267fd66b",
1084
+ "metadata": {},
1085
+ "outputs": [],
1086
+ "source": [
1087
+ "df_cont = df_cont.reset_index()"
1088
+ ]
1089
+ },
1090
+ {
1091
+ "cell_type": "code",
1092
+ "execution_count": 78,
1093
+ "id": "8ddaf798-772d-489d-b2fc-32d4cd76ae50",
1094
+ "metadata": {},
1095
+ "outputs": [
1096
+ {
1097
+ "data": {
1098
+ "text/plain": [
1099
+ "166"
1100
+ ]
1101
+ },
1102
+ "execution_count": 78,
1103
+ "metadata": {},
1104
+ "output_type": "execute_result"
1105
+ }
1106
+ ],
1107
+ "source": [
1108
+ "len(df_cont)"
1109
+ ]
1110
+ },
1111
+ {
1112
+ "cell_type": "code",
1113
+ "execution_count": 79,
1114
+ "id": "7420265a-e079-443c-9be0-01becf73a836",
1115
+ "metadata": {},
1116
+ "outputs": [
1117
+ {
1118
+ "data": {
1119
+ "text/html": [
1120
+ "<div>\n",
1121
+ "<style scoped>\n",
1122
+ " .dataframe tbody tr th:only-of-type {\n",
1123
+ " vertical-align: middle;\n",
1124
+ " }\n",
1125
+ "\n",
1126
+ " .dataframe tbody tr th {\n",
1127
+ " vertical-align: top;\n",
1128
+ " }\n",
1129
+ "\n",
1130
+ " .dataframe thead th {\n",
1131
+ " text-align: right;\n",
1132
+ " }\n",
1133
+ "</style>\n",
1134
+ "<table border=\"1\" class=\"dataframe\">\n",
1135
+ " <thead>\n",
1136
+ " <tr style=\"text-align: right;\">\n",
1137
+ " <th></th>\n",
1138
+ " <th>Country</th>\n",
1139
+ " <th>year</th>\n",
1140
+ " <th>Life Ladder</th>\n",
1141
+ " <th>Log GDP per capita</th>\n",
1142
+ " <th>Social support</th>\n",
1143
+ " <th>Healthy life expectancy at birth</th>\n",
1144
+ " <th>Freedom to make life choices</th>\n",
1145
+ " <th>Generosity</th>\n",
1146
+ " <th>Perceptions of corruption</th>\n",
1147
+ " <th>Positive affect</th>\n",
1148
+ " <th>Negative affect</th>\n",
1149
+ " <th>Continent</th>\n",
1150
+ " </tr>\n",
1151
+ " </thead>\n",
1152
+ " <tbody>\n",
1153
+ " <tr>\n",
1154
+ " <th>0</th>\n",
1155
+ " <td>Zimbabwe</td>\n",
1156
+ " <td>2020</td>\n",
1157
+ " <td>3.159802</td>\n",
1158
+ " <td>7.828757</td>\n",
1159
+ " <td>0.717243</td>\n",
1160
+ " <td>56.799999</td>\n",
1161
+ " <td>0.643303</td>\n",
1162
+ " <td>-0.008696</td>\n",
1163
+ " <td>0.788523</td>\n",
1164
+ " <td>0.702573</td>\n",
1165
+ " <td>0.345736</td>\n",
1166
+ " <td>Africa</td>\n",
1167
+ " </tr>\n",
1168
+ " <tr>\n",
1169
+ " <th>1</th>\n",
1170
+ " <td>Benin</td>\n",
1171
+ " <td>2020</td>\n",
1172
+ " <td>4.407746</td>\n",
1173
+ " <td>8.102292</td>\n",
1174
+ " <td>0.506636</td>\n",
1175
+ " <td>55.099998</td>\n",
1176
+ " <td>0.783115</td>\n",
1177
+ " <td>-0.083489</td>\n",
1178
+ " <td>0.531884</td>\n",
1179
+ " <td>0.608585</td>\n",
1180
+ " <td>0.304512</td>\n",
1181
+ " <td>Africa</td>\n",
1182
+ " </tr>\n",
1183
+ " <tr>\n",
1184
+ " <th>2</th>\n",
1185
+ " <td>United Kingdom</td>\n",
1186
+ " <td>2020</td>\n",
1187
+ " <td>6.798177</td>\n",
1188
+ " <td>10.625811</td>\n",
1189
+ " <td>0.929353</td>\n",
1190
+ " <td>72.699997</td>\n",
1191
+ " <td>0.884624</td>\n",
1192
+ " <td>0.202508</td>\n",
1193
+ " <td>0.490204</td>\n",
1194
+ " <td>0.758164</td>\n",
1195
+ " <td>0.224655</td>\n",
1196
+ " <td>Europe</td>\n",
1197
+ " </tr>\n",
1198
+ " <tr>\n",
1199
+ " <th>3</th>\n",
1200
+ " <td>Philippines</td>\n",
1201
+ " <td>2020</td>\n",
1202
+ " <td>5.079585</td>\n",
1203
+ " <td>9.061443</td>\n",
1204
+ " <td>0.781140</td>\n",
1205
+ " <td>62.099998</td>\n",
1206
+ " <td>0.932042</td>\n",
1207
+ " <td>-0.115543</td>\n",
1208
+ " <td>0.744284</td>\n",
1209
+ " <td>0.803562</td>\n",
1210
+ " <td>0.326889</td>\n",
1211
+ " <td>Asia</td>\n",
1212
+ " </tr>\n",
1213
+ " <tr>\n",
1214
+ " <th>4</th>\n",
1215
+ " <td>Iraq</td>\n",
1216
+ " <td>2020</td>\n",
1217
+ " <td>4.785165</td>\n",
1218
+ " <td>9.167186</td>\n",
1219
+ " <td>0.707847</td>\n",
1220
+ " <td>61.400002</td>\n",
1221
+ " <td>0.700215</td>\n",
1222
+ " <td>-0.020748</td>\n",
1223
+ " <td>0.849109</td>\n",
1224
+ " <td>0.644464</td>\n",
1225
+ " <td>0.531539</td>\n",
1226
+ " <td>Asia</td>\n",
1227
+ " </tr>\n",
1228
+ " </tbody>\n",
1229
+ "</table>\n",
1230
+ "</div>"
1231
+ ],
1232
+ "text/plain": [
1233
+ " Country year Life Ladder Log GDP per capita Social support \\\n",
1234
+ "0 Zimbabwe 2020 3.159802 7.828757 0.717243 \n",
1235
+ "1 Benin 2020 4.407746 8.102292 0.506636 \n",
1236
+ "2 United Kingdom 2020 6.798177 10.625811 0.929353 \n",
1237
+ "3 Philippines 2020 5.079585 9.061443 0.781140 \n",
1238
+ "4 Iraq 2020 4.785165 9.167186 0.707847 \n",
1239
+ "\n",
1240
+ " Healthy life expectancy at birth Freedom to make life choices Generosity \\\n",
1241
+ "0 56.799999 0.643303 -0.008696 \n",
1242
+ "1 55.099998 0.783115 -0.083489 \n",
1243
+ "2 72.699997 0.884624 0.202508 \n",
1244
+ "3 62.099998 0.932042 -0.115543 \n",
1245
+ "4 61.400002 0.700215 -0.020748 \n",
1246
+ "\n",
1247
+ " Perceptions of corruption Positive affect Negative affect Continent \n",
1248
+ "0 0.788523 0.702573 0.345736 Africa \n",
1249
+ "1 0.531884 0.608585 0.304512 Africa \n",
1250
+ "2 0.490204 0.758164 0.224655 Europe \n",
1251
+ "3 0.744284 0.803562 0.326889 Asia \n",
1252
+ "4 0.849109 0.644464 0.531539 Asia "
1253
+ ]
1254
+ },
1255
+ "execution_count": 79,
1256
+ "metadata": {},
1257
+ "output_type": "execute_result"
1258
+ }
1259
+ ],
1260
+ "source": [
1261
+ "df_cont.head()"
1262
+ ]
1263
+ },
1264
+ {
1265
+ "cell_type": "code",
1266
+ "execution_count": 81,
1267
+ "id": "fb26fc2f-f591-4e66-9357-0928c2c46e89",
1268
+ "metadata": {},
1269
+ "outputs": [],
1270
+ "source": [
1271
+ "# I updated the name of the output so that I don't accidentally overwrite the manual work I did at the end to add in the last few outliers.\n",
1272
+ "#df_cont.to_csv(\"Assets/Countries/base-combined-countries.csv\")"
1273
+ ]
1274
+ },
1275
+ {
1276
+ "cell_type": "code",
1277
+ "execution_count": 83,
1278
+ "id": "445a79b2-0023-4812-b606-1ff9cb7720e7",
1279
+ "metadata": {},
1280
+ "outputs": [],
1281
+ "source": [
1282
+ "df3 = df_csv.set_index('Country').join(df_dedup.set_index('Country'), on='Country', how='left')"
1283
+ ]
1284
+ },
1285
+ {
1286
+ "cell_type": "code",
1287
+ "execution_count": 87,
1288
+ "id": "59c3d6bb-11ea-4b4f-9a9e-d9b58561e8f2",
1289
+ "metadata": {},
1290
+ "outputs": [],
1291
+ "source": [
1292
+ "df3 = df3[df3.year.isnull()]"
1293
+ ]
1294
+ },
1295
+ {
1296
+ "cell_type": "code",
1297
+ "execution_count": 88,
1298
+ "id": "3b76dce1-a02f-4b09-bc44-b0e28271bc56",
1299
+ "metadata": {},
1300
+ "outputs": [
1301
+ {
1302
+ "data": {
1303
+ "text/html": [
1304
+ "<div>\n",
1305
+ "<style scoped>\n",
1306
+ " .dataframe tbody tr th:only-of-type {\n",
1307
+ " vertical-align: middle;\n",
1308
+ " }\n",
1309
+ "\n",
1310
+ " .dataframe tbody tr th {\n",
1311
+ " vertical-align: top;\n",
1312
+ " }\n",
1313
+ "\n",
1314
+ " .dataframe thead th {\n",
1315
+ " text-align: right;\n",
1316
+ " }\n",
1317
+ "</style>\n",
1318
+ "<table border=\"1\" class=\"dataframe\">\n",
1319
+ " <thead>\n",
1320
+ " <tr style=\"text-align: right;\">\n",
1321
+ " <th></th>\n",
1322
+ " <th>Continent</th>\n",
1323
+ " <th>year</th>\n",
1324
+ " <th>Life Ladder</th>\n",
1325
+ " <th>Log GDP per capita</th>\n",
1326
+ " <th>Social support</th>\n",
1327
+ " <th>Healthy life expectancy at birth</th>\n",
1328
+ " <th>Freedom to make life choices</th>\n",
1329
+ " <th>Generosity</th>\n",
1330
+ " <th>Perceptions of corruption</th>\n",
1331
+ " <th>Positive affect</th>\n",
1332
+ " <th>Negative affect</th>\n",
1333
+ " </tr>\n",
1334
+ " <tr>\n",
1335
+ " <th>Country</th>\n",
1336
+ " <th></th>\n",
1337
+ " <th></th>\n",
1338
+ " <th></th>\n",
1339
+ " <th></th>\n",
1340
+ " <th></th>\n",
1341
+ " <th></th>\n",
1342
+ " <th></th>\n",
1343
+ " <th></th>\n",
1344
+ " <th></th>\n",
1345
+ " <th></th>\n",
1346
+ " <th></th>\n",
1347
+ " </tr>\n",
1348
+ " </thead>\n",
1349
+ " <tbody>\n",
1350
+ " <tr>\n",
1351
+ " <th>Burkina</th>\n",
1352
+ " <td>Africa</td>\n",
1353
+ " <td>NaN</td>\n",
1354
+ " <td>NaN</td>\n",
1355
+ " <td>NaN</td>\n",
1356
+ " <td>NaN</td>\n",
1357
+ " <td>NaN</td>\n",
1358
+ " <td>NaN</td>\n",
1359
+ " <td>NaN</td>\n",
1360
+ " <td>NaN</td>\n",
1361
+ " <td>NaN</td>\n",
1362
+ " <td>NaN</td>\n",
1363
+ " </tr>\n",
1364
+ " <tr>\n",
1365
+ " <th>Cape Verde</th>\n",
1366
+ " <td>Africa</td>\n",
1367
+ " <td>NaN</td>\n",
1368
+ " <td>NaN</td>\n",
1369
+ " <td>NaN</td>\n",
1370
+ " <td>NaN</td>\n",
1371
+ " <td>NaN</td>\n",
1372
+ " <td>NaN</td>\n",
1373
+ " <td>NaN</td>\n",
1374
+ " <td>NaN</td>\n",
1375
+ " <td>NaN</td>\n",
1376
+ " <td>NaN</td>\n",
1377
+ " </tr>\n",
1378
+ " <tr>\n",
1379
+ " <th>Congo</th>\n",
1380
+ " <td>Africa</td>\n",
1381
+ " <td>NaN</td>\n",
1382
+ " <td>NaN</td>\n",
1383
+ " <td>NaN</td>\n",
1384
+ " <td>NaN</td>\n",
1385
+ " <td>NaN</td>\n",
1386
+ " <td>NaN</td>\n",
1387
+ " <td>NaN</td>\n",
1388
+ " <td>NaN</td>\n",
1389
+ " <td>NaN</td>\n",
1390
+ " <td>NaN</td>\n",
1391
+ " </tr>\n",
1392
+ " <tr>\n",
1393
+ " <th>Congo, Democratic Republic of</th>\n",
1394
+ " <td>Africa</td>\n",
1395
+ " <td>NaN</td>\n",
1396
+ " <td>NaN</td>\n",
1397
+ " <td>NaN</td>\n",
1398
+ " <td>NaN</td>\n",
1399
+ " <td>NaN</td>\n",
1400
+ " <td>NaN</td>\n",
1401
+ " <td>NaN</td>\n",
1402
+ " <td>NaN</td>\n",
1403
+ " <td>NaN</td>\n",
1404
+ " <td>NaN</td>\n",
1405
+ " </tr>\n",
1406
+ " <tr>\n",
1407
+ " <th>Equatorial Guinea</th>\n",
1408
+ " <td>Africa</td>\n",
1409
+ " <td>NaN</td>\n",
1410
+ " <td>NaN</td>\n",
1411
+ " <td>NaN</td>\n",
1412
+ " <td>NaN</td>\n",
1413
+ " <td>NaN</td>\n",
1414
+ " <td>NaN</td>\n",
1415
+ " <td>NaN</td>\n",
1416
+ " <td>NaN</td>\n",
1417
+ " <td>NaN</td>\n",
1418
+ " <td>NaN</td>\n",
1419
+ " </tr>\n",
1420
+ " <tr>\n",
1421
+ " <th>Eritrea</th>\n",
1422
+ " <td>Africa</td>\n",
1423
+ " <td>NaN</td>\n",
1424
+ " <td>NaN</td>\n",
1425
+ " <td>NaN</td>\n",
1426
+ " <td>NaN</td>\n",
1427
+ " <td>NaN</td>\n",
1428
+ " <td>NaN</td>\n",
1429
+ " <td>NaN</td>\n",
1430
+ " <td>NaN</td>\n",
1431
+ " <td>NaN</td>\n",
1432
+ " <td>NaN</td>\n",
1433
+ " </tr>\n",
1434
+ " <tr>\n",
1435
+ " <th>Guinea-Bissau</th>\n",
1436
+ " <td>Africa</td>\n",
1437
+ " <td>NaN</td>\n",
1438
+ " <td>NaN</td>\n",
1439
+ " <td>NaN</td>\n",
1440
+ " <td>NaN</td>\n",
1441
+ " <td>NaN</td>\n",
1442
+ " <td>NaN</td>\n",
1443
+ " <td>NaN</td>\n",
1444
+ " <td>NaN</td>\n",
1445
+ " <td>NaN</td>\n",
1446
+ " <td>NaN</td>\n",
1447
+ " </tr>\n",
1448
+ " <tr>\n",
1449
+ " <th>Sao Tome and Principe</th>\n",
1450
+ " <td>Africa</td>\n",
1451
+ " <td>NaN</td>\n",
1452
+ " <td>NaN</td>\n",
1453
+ " <td>NaN</td>\n",
1454
+ " <td>NaN</td>\n",
1455
+ " <td>NaN</td>\n",
1456
+ " <td>NaN</td>\n",
1457
+ " <td>NaN</td>\n",
1458
+ " <td>NaN</td>\n",
1459
+ " <td>NaN</td>\n",
1460
+ " <td>NaN</td>\n",
1461
+ " </tr>\n",
1462
+ " <tr>\n",
1463
+ " <th>Seychelles</th>\n",
1464
+ " <td>Africa</td>\n",
1465
+ " <td>NaN</td>\n",
1466
+ " <td>NaN</td>\n",
1467
+ " <td>NaN</td>\n",
1468
+ " <td>NaN</td>\n",
1469
+ " <td>NaN</td>\n",
1470
+ " <td>NaN</td>\n",
1471
+ " <td>NaN</td>\n",
1472
+ " <td>NaN</td>\n",
1473
+ " <td>NaN</td>\n",
1474
+ " <td>NaN</td>\n",
1475
+ " </tr>\n",
1476
+ " <tr>\n",
1477
+ " <th>Brunei</th>\n",
1478
+ " <td>Asia</td>\n",
1479
+ " <td>NaN</td>\n",
1480
+ " <td>NaN</td>\n",
1481
+ " <td>NaN</td>\n",
1482
+ " <td>NaN</td>\n",
1483
+ " <td>NaN</td>\n",
1484
+ " <td>NaN</td>\n",
1485
+ " <td>NaN</td>\n",
1486
+ " <td>NaN</td>\n",
1487
+ " <td>NaN</td>\n",
1488
+ " <td>NaN</td>\n",
1489
+ " </tr>\n",
1490
+ " <tr>\n",
1491
+ " <th>Burma (Myanmar)</th>\n",
1492
+ " <td>Asia</td>\n",
1493
+ " <td>NaN</td>\n",
1494
+ " <td>NaN</td>\n",
1495
+ " <td>NaN</td>\n",
1496
+ " <td>NaN</td>\n",
1497
+ " <td>NaN</td>\n",
1498
+ " <td>NaN</td>\n",
1499
+ " <td>NaN</td>\n",
1500
+ " <td>NaN</td>\n",
1501
+ " <td>NaN</td>\n",
1502
+ " <td>NaN</td>\n",
1503
+ " </tr>\n",
1504
+ " <tr>\n",
1505
+ " <th>East Timor</th>\n",
1506
+ " <td>Asia</td>\n",
1507
+ " <td>NaN</td>\n",
1508
+ " <td>NaN</td>\n",
1509
+ " <td>NaN</td>\n",
1510
+ " <td>NaN</td>\n",
1511
+ " <td>NaN</td>\n",
1512
+ " <td>NaN</td>\n",
1513
+ " <td>NaN</td>\n",
1514
+ " <td>NaN</td>\n",
1515
+ " <td>NaN</td>\n",
1516
+ " <td>NaN</td>\n",
1517
+ " </tr>\n",
1518
+ " <tr>\n",
1519
+ " <th>Korea, North</th>\n",
1520
+ " <td>Asia</td>\n",
1521
+ " <td>NaN</td>\n",
1522
+ " <td>NaN</td>\n",
1523
+ " <td>NaN</td>\n",
1524
+ " <td>NaN</td>\n",
1525
+ " <td>NaN</td>\n",
1526
+ " <td>NaN</td>\n",
1527
+ " <td>NaN</td>\n",
1528
+ " <td>NaN</td>\n",
1529
+ " <td>NaN</td>\n",
1530
+ " <td>NaN</td>\n",
1531
+ " </tr>\n",
1532
+ " <tr>\n",
1533
+ " <th>Korea, South</th>\n",
1534
+ " <td>Asia</td>\n",
1535
+ " <td>NaN</td>\n",
1536
+ " <td>NaN</td>\n",
1537
+ " <td>NaN</td>\n",
1538
+ " <td>NaN</td>\n",
1539
+ " <td>NaN</td>\n",
1540
+ " <td>NaN</td>\n",
1541
+ " <td>NaN</td>\n",
1542
+ " <td>NaN</td>\n",
1543
+ " <td>NaN</td>\n",
1544
+ " <td>NaN</td>\n",
1545
+ " </tr>\n",
1546
+ " <tr>\n",
1547
+ " <th>Russian Federation</th>\n",
1548
+ " <td>Asia</td>\n",
1549
+ " <td>NaN</td>\n",
1550
+ " <td>NaN</td>\n",
1551
+ " <td>NaN</td>\n",
1552
+ " <td>NaN</td>\n",
1553
+ " <td>NaN</td>\n",
1554
+ " <td>NaN</td>\n",
1555
+ " <td>NaN</td>\n",
1556
+ " <td>NaN</td>\n",
1557
+ " <td>NaN</td>\n",
1558
+ " <td>NaN</td>\n",
1559
+ " </tr>\n",
1560
+ " <tr>\n",
1561
+ " <th>Andorra</th>\n",
1562
+ " <td>Europe</td>\n",
1563
+ " <td>NaN</td>\n",
1564
+ " <td>NaN</td>\n",
1565
+ " <td>NaN</td>\n",
1566
+ " <td>NaN</td>\n",
1567
+ " <td>NaN</td>\n",
1568
+ " <td>NaN</td>\n",
1569
+ " <td>NaN</td>\n",
1570
+ " <td>NaN</td>\n",
1571
+ " <td>NaN</td>\n",
1572
+ " <td>NaN</td>\n",
1573
+ " </tr>\n",
1574
+ " <tr>\n",
1575
+ " <th>CZ</th>\n",
1576
+ " <td>Europe</td>\n",
1577
+ " <td>NaN</td>\n",
1578
+ " <td>NaN</td>\n",
1579
+ " <td>NaN</td>\n",
1580
+ " <td>NaN</td>\n",
1581
+ " <td>NaN</td>\n",
1582
+ " <td>NaN</td>\n",
1583
+ " <td>NaN</td>\n",
1584
+ " <td>NaN</td>\n",
1585
+ " <td>NaN</td>\n",
1586
+ " <td>NaN</td>\n",
1587
+ " </tr>\n",
1588
+ " <tr>\n",
1589
+ " <th>Liechtenstein</th>\n",
1590
+ " <td>Europe</td>\n",
1591
+ " <td>NaN</td>\n",
1592
+ " <td>NaN</td>\n",
1593
+ " <td>NaN</td>\n",
1594
+ " <td>NaN</td>\n",
1595
+ " <td>NaN</td>\n",
1596
+ " <td>NaN</td>\n",
1597
+ " <td>NaN</td>\n",
1598
+ " <td>NaN</td>\n",
1599
+ " <td>NaN</td>\n",
1600
+ " <td>NaN</td>\n",
1601
+ " </tr>\n",
1602
+ " <tr>\n",
1603
+ " <th>Macedonia</th>\n",
1604
+ " <td>Europe</td>\n",
1605
+ " <td>NaN</td>\n",
1606
+ " <td>NaN</td>\n",
1607
+ " <td>NaN</td>\n",
1608
+ " <td>NaN</td>\n",
1609
+ " <td>NaN</td>\n",
1610
+ " <td>NaN</td>\n",
1611
+ " <td>NaN</td>\n",
1612
+ " <td>NaN</td>\n",
1613
+ " <td>NaN</td>\n",
1614
+ " <td>NaN</td>\n",
1615
+ " </tr>\n",
1616
+ " <tr>\n",
1617
+ " <th>Monaco</th>\n",
1618
+ " <td>Europe</td>\n",
1619
+ " <td>NaN</td>\n",
1620
+ " <td>NaN</td>\n",
1621
+ " <td>NaN</td>\n",
1622
+ " <td>NaN</td>\n",
1623
+ " <td>NaN</td>\n",
1624
+ " <td>NaN</td>\n",
1625
+ " <td>NaN</td>\n",
1626
+ " <td>NaN</td>\n",
1627
+ " <td>NaN</td>\n",
1628
+ " <td>NaN</td>\n",
1629
+ " </tr>\n",
1630
+ " <tr>\n",
1631
+ " <th>San Marino</th>\n",
1632
+ " <td>Europe</td>\n",
1633
+ " <td>NaN</td>\n",
1634
+ " <td>NaN</td>\n",
1635
+ " <td>NaN</td>\n",
1636
+ " <td>NaN</td>\n",
1637
+ " <td>NaN</td>\n",
1638
+ " <td>NaN</td>\n",
1639
+ " <td>NaN</td>\n",
1640
+ " <td>NaN</td>\n",
1641
+ " <td>NaN</td>\n",
1642
+ " <td>NaN</td>\n",
1643
+ " </tr>\n",
1644
+ " <tr>\n",
1645
+ " <th>Vatican City</th>\n",
1646
+ " <td>Europe</td>\n",
1647
+ " <td>NaN</td>\n",
1648
+ " <td>NaN</td>\n",
1649
+ " <td>NaN</td>\n",
1650
+ " <td>NaN</td>\n",
1651
+ " <td>NaN</td>\n",
1652
+ " <td>NaN</td>\n",
1653
+ " <td>NaN</td>\n",
1654
+ " <td>NaN</td>\n",
1655
+ " <td>NaN</td>\n",
1656
+ " <td>NaN</td>\n",
1657
+ " </tr>\n",
1658
+ " <tr>\n",
1659
+ " <th>Antigua and Barbuda</th>\n",
1660
+ " <td>North America</td>\n",
1661
+ " <td>NaN</td>\n",
1662
+ " <td>NaN</td>\n",
1663
+ " <td>NaN</td>\n",
1664
+ " <td>NaN</td>\n",
1665
+ " <td>NaN</td>\n",
1666
+ " <td>NaN</td>\n",
1667
+ " <td>NaN</td>\n",
1668
+ " <td>NaN</td>\n",
1669
+ " <td>NaN</td>\n",
1670
+ " <td>NaN</td>\n",
1671
+ " </tr>\n",
1672
+ " <tr>\n",
1673
+ " <th>Bahamas</th>\n",
1674
+ " <td>North America</td>\n",
1675
+ " <td>NaN</td>\n",
1676
+ " <td>NaN</td>\n",
1677
+ " <td>NaN</td>\n",
1678
+ " <td>NaN</td>\n",
1679
+ " <td>NaN</td>\n",
1680
+ " <td>NaN</td>\n",
1681
+ " <td>NaN</td>\n",
1682
+ " <td>NaN</td>\n",
1683
+ " <td>NaN</td>\n",
1684
+ " <td>NaN</td>\n",
1685
+ " </tr>\n",
1686
+ " <tr>\n",
1687
+ " <th>Barbados</th>\n",
1688
+ " <td>North America</td>\n",
1689
+ " <td>NaN</td>\n",
1690
+ " <td>NaN</td>\n",
1691
+ " <td>NaN</td>\n",
1692
+ " <td>NaN</td>\n",
1693
+ " <td>NaN</td>\n",
1694
+ " <td>NaN</td>\n",
1695
+ " <td>NaN</td>\n",
1696
+ " <td>NaN</td>\n",
1697
+ " <td>NaN</td>\n",
1698
+ " <td>NaN</td>\n",
1699
+ " </tr>\n",
1700
+ " <tr>\n",
1701
+ " <th>Dominica</th>\n",
1702
+ " <td>North America</td>\n",
1703
+ " <td>NaN</td>\n",
1704
+ " <td>NaN</td>\n",
1705
+ " <td>NaN</td>\n",
1706
+ " <td>NaN</td>\n",
1707
+ " <td>NaN</td>\n",
1708
+ " <td>NaN</td>\n",
1709
+ " <td>NaN</td>\n",
1710
+ " <td>NaN</td>\n",
1711
+ " <td>NaN</td>\n",
1712
+ " <td>NaN</td>\n",
1713
+ " </tr>\n",
1714
+ " <tr>\n",
1715
+ " <th>Grenada</th>\n",
1716
+ " <td>North America</td>\n",
1717
+ " <td>NaN</td>\n",
1718
+ " <td>NaN</td>\n",
1719
+ " <td>NaN</td>\n",
1720
+ " <td>NaN</td>\n",
1721
+ " <td>NaN</td>\n",
1722
+ " <td>NaN</td>\n",
1723
+ " <td>NaN</td>\n",
1724
+ " <td>NaN</td>\n",
1725
+ " <td>NaN</td>\n",
1726
+ " <td>NaN</td>\n",
1727
+ " </tr>\n",
1728
+ " <tr>\n",
1729
+ " <th>Saint Kitts and Nevis</th>\n",
1730
+ " <td>North America</td>\n",
1731
+ " <td>NaN</td>\n",
1732
+ " <td>NaN</td>\n",
1733
+ " <td>NaN</td>\n",
1734
+ " <td>NaN</td>\n",
1735
+ " <td>NaN</td>\n",
1736
+ " <td>NaN</td>\n",
1737
+ " <td>NaN</td>\n",
1738
+ " <td>NaN</td>\n",
1739
+ " <td>NaN</td>\n",
1740
+ " <td>NaN</td>\n",
1741
+ " </tr>\n",
1742
+ " <tr>\n",
1743
+ " <th>Saint Lucia</th>\n",
1744
+ " <td>North America</td>\n",
1745
+ " <td>NaN</td>\n",
1746
+ " <td>NaN</td>\n",
1747
+ " <td>NaN</td>\n",
1748
+ " <td>NaN</td>\n",
1749
+ " <td>NaN</td>\n",
1750
+ " <td>NaN</td>\n",
1751
+ " <td>NaN</td>\n",
1752
+ " <td>NaN</td>\n",
1753
+ " <td>NaN</td>\n",
1754
+ " <td>NaN</td>\n",
1755
+ " </tr>\n",
1756
+ " <tr>\n",
1757
+ " <th>Saint Vincent and the Grenadines</th>\n",
1758
+ " <td>North America</td>\n",
1759
+ " <td>NaN</td>\n",
1760
+ " <td>NaN</td>\n",
1761
+ " <td>NaN</td>\n",
1762
+ " <td>NaN</td>\n",
1763
+ " <td>NaN</td>\n",
1764
+ " <td>NaN</td>\n",
1765
+ " <td>NaN</td>\n",
1766
+ " <td>NaN</td>\n",
1767
+ " <td>NaN</td>\n",
1768
+ " <td>NaN</td>\n",
1769
+ " </tr>\n",
1770
+ " <tr>\n",
1771
+ " <th>US</th>\n",
1772
+ " <td>North America</td>\n",
1773
+ " <td>NaN</td>\n",
1774
+ " <td>NaN</td>\n",
1775
+ " <td>NaN</td>\n",
1776
+ " <td>NaN</td>\n",
1777
+ " <td>NaN</td>\n",
1778
+ " <td>NaN</td>\n",
1779
+ " <td>NaN</td>\n",
1780
+ " <td>NaN</td>\n",
1781
+ " <td>NaN</td>\n",
1782
+ " <td>NaN</td>\n",
1783
+ " </tr>\n",
1784
+ " <tr>\n",
1785
+ " <th>Fiji</th>\n",
1786
+ " <td>Oceania</td>\n",
1787
+ " <td>NaN</td>\n",
1788
+ " <td>NaN</td>\n",
1789
+ " <td>NaN</td>\n",
1790
+ " <td>NaN</td>\n",
1791
+ " <td>NaN</td>\n",
1792
+ " <td>NaN</td>\n",
1793
+ " <td>NaN</td>\n",
1794
+ " <td>NaN</td>\n",
1795
+ " <td>NaN</td>\n",
1796
+ " <td>NaN</td>\n",
1797
+ " </tr>\n",
1798
+ " <tr>\n",
1799
+ " <th>Kiribati</th>\n",
1800
+ " <td>Oceania</td>\n",
1801
+ " <td>NaN</td>\n",
1802
+ " <td>NaN</td>\n",
1803
+ " <td>NaN</td>\n",
1804
+ " <td>NaN</td>\n",
1805
+ " <td>NaN</td>\n",
1806
+ " <td>NaN</td>\n",
1807
+ " <td>NaN</td>\n",
1808
+ " <td>NaN</td>\n",
1809
+ " <td>NaN</td>\n",
1810
+ " <td>NaN</td>\n",
1811
+ " </tr>\n",
1812
+ " <tr>\n",
1813
+ " <th>Marshall Islands</th>\n",
1814
+ " <td>Oceania</td>\n",
1815
+ " <td>NaN</td>\n",
1816
+ " <td>NaN</td>\n",
1817
+ " <td>NaN</td>\n",
1818
+ " <td>NaN</td>\n",
1819
+ " <td>NaN</td>\n",
1820
+ " <td>NaN</td>\n",
1821
+ " <td>NaN</td>\n",
1822
+ " <td>NaN</td>\n",
1823
+ " <td>NaN</td>\n",
1824
+ " <td>NaN</td>\n",
1825
+ " </tr>\n",
1826
+ " <tr>\n",
1827
+ " <th>Micronesia</th>\n",
1828
+ " <td>Oceania</td>\n",
1829
+ " <td>NaN</td>\n",
1830
+ " <td>NaN</td>\n",
1831
+ " <td>NaN</td>\n",
1832
+ " <td>NaN</td>\n",
1833
+ " <td>NaN</td>\n",
1834
+ " <td>NaN</td>\n",
1835
+ " <td>NaN</td>\n",
1836
+ " <td>NaN</td>\n",
1837
+ " <td>NaN</td>\n",
1838
+ " <td>NaN</td>\n",
1839
+ " </tr>\n",
1840
+ " <tr>\n",
1841
+ " <th>Nauru</th>\n",
1842
+ " <td>Oceania</td>\n",
1843
+ " <td>NaN</td>\n",
1844
+ " <td>NaN</td>\n",
1845
+ " <td>NaN</td>\n",
1846
+ " <td>NaN</td>\n",
1847
+ " <td>NaN</td>\n",
1848
+ " <td>NaN</td>\n",
1849
+ " <td>NaN</td>\n",
1850
+ " <td>NaN</td>\n",
1851
+ " <td>NaN</td>\n",
1852
+ " <td>NaN</td>\n",
1853
+ " </tr>\n",
1854
+ " <tr>\n",
1855
+ " <th>Palau</th>\n",
1856
+ " <td>Oceania</td>\n",
1857
+ " <td>NaN</td>\n",
1858
+ " <td>NaN</td>\n",
1859
+ " <td>NaN</td>\n",
1860
+ " <td>NaN</td>\n",
1861
+ " <td>NaN</td>\n",
1862
+ " <td>NaN</td>\n",
1863
+ " <td>NaN</td>\n",
1864
+ " <td>NaN</td>\n",
1865
+ " <td>NaN</td>\n",
1866
+ " <td>NaN</td>\n",
1867
+ " </tr>\n",
1868
+ " <tr>\n",
1869
+ " <th>Papua New Guinea</th>\n",
1870
+ " <td>Oceania</td>\n",
1871
+ " <td>NaN</td>\n",
1872
+ " <td>NaN</td>\n",
1873
+ " <td>NaN</td>\n",
1874
+ " <td>NaN</td>\n",
1875
+ " <td>NaN</td>\n",
1876
+ " <td>NaN</td>\n",
1877
+ " <td>NaN</td>\n",
1878
+ " <td>NaN</td>\n",
1879
+ " <td>NaN</td>\n",
1880
+ " <td>NaN</td>\n",
1881
+ " </tr>\n",
1882
+ " <tr>\n",
1883
+ " <th>Samoa</th>\n",
1884
+ " <td>Oceania</td>\n",
1885
+ " <td>NaN</td>\n",
1886
+ " <td>NaN</td>\n",
1887
+ " <td>NaN</td>\n",
1888
+ " <td>NaN</td>\n",
1889
+ " <td>NaN</td>\n",
1890
+ " <td>NaN</td>\n",
1891
+ " <td>NaN</td>\n",
1892
+ " <td>NaN</td>\n",
1893
+ " <td>NaN</td>\n",
1894
+ " <td>NaN</td>\n",
1895
+ " </tr>\n",
1896
+ " <tr>\n",
1897
+ " <th>Solomon Islands</th>\n",
1898
+ " <td>Oceania</td>\n",
1899
+ " <td>NaN</td>\n",
1900
+ " <td>NaN</td>\n",
1901
+ " <td>NaN</td>\n",
1902
+ " <td>NaN</td>\n",
1903
+ " <td>NaN</td>\n",
1904
+ " <td>NaN</td>\n",
1905
+ " <td>NaN</td>\n",
1906
+ " <td>NaN</td>\n",
1907
+ " <td>NaN</td>\n",
1908
+ " <td>NaN</td>\n",
1909
+ " </tr>\n",
1910
+ " <tr>\n",
1911
+ " <th>Tonga</th>\n",
1912
+ " <td>Oceania</td>\n",
1913
+ " <td>NaN</td>\n",
1914
+ " <td>NaN</td>\n",
1915
+ " <td>NaN</td>\n",
1916
+ " <td>NaN</td>\n",
1917
+ " <td>NaN</td>\n",
1918
+ " <td>NaN</td>\n",
1919
+ " <td>NaN</td>\n",
1920
+ " <td>NaN</td>\n",
1921
+ " <td>NaN</td>\n",
1922
+ " <td>NaN</td>\n",
1923
+ " </tr>\n",
1924
+ " <tr>\n",
1925
+ " <th>Tuvalu</th>\n",
1926
+ " <td>Oceania</td>\n",
1927
+ " <td>NaN</td>\n",
1928
+ " <td>NaN</td>\n",
1929
+ " <td>NaN</td>\n",
1930
+ " <td>NaN</td>\n",
1931
+ " <td>NaN</td>\n",
1932
+ " <td>NaN</td>\n",
1933
+ " <td>NaN</td>\n",
1934
+ " <td>NaN</td>\n",
1935
+ " <td>NaN</td>\n",
1936
+ " <td>NaN</td>\n",
1937
+ " </tr>\n",
1938
+ " <tr>\n",
1939
+ " <th>Vanuatu</th>\n",
1940
+ " <td>Oceania</td>\n",
1941
+ " <td>NaN</td>\n",
1942
+ " <td>NaN</td>\n",
1943
+ " <td>NaN</td>\n",
1944
+ " <td>NaN</td>\n",
1945
+ " <td>NaN</td>\n",
1946
+ " <td>NaN</td>\n",
1947
+ " <td>NaN</td>\n",
1948
+ " <td>NaN</td>\n",
1949
+ " <td>NaN</td>\n",
1950
+ " <td>NaN</td>\n",
1951
+ " </tr>\n",
1952
+ " </tbody>\n",
1953
+ "</table>\n",
1954
+ "</div>"
1955
+ ],
1956
+ "text/plain": [
1957
+ " Continent year Life Ladder \\\n",
1958
+ "Country \n",
1959
+ "Burkina Africa NaN NaN \n",
1960
+ "Cape Verde Africa NaN NaN \n",
1961
+ "Congo Africa NaN NaN \n",
1962
+ "Congo, Democratic Republic of Africa NaN NaN \n",
1963
+ "Equatorial Guinea Africa NaN NaN \n",
1964
+ "Eritrea Africa NaN NaN \n",
1965
+ "Guinea-Bissau Africa NaN NaN \n",
1966
+ "Sao Tome and Principe Africa NaN NaN \n",
1967
+ "Seychelles Africa NaN NaN \n",
1968
+ "Brunei Asia NaN NaN \n",
1969
+ "Burma (Myanmar) Asia NaN NaN \n",
1970
+ "East Timor Asia NaN NaN \n",
1971
+ "Korea, North Asia NaN NaN \n",
1972
+ "Korea, South Asia NaN NaN \n",
1973
+ "Russian Federation Asia NaN NaN \n",
1974
+ "Andorra Europe NaN NaN \n",
1975
+ "CZ Europe NaN NaN \n",
1976
+ "Liechtenstein Europe NaN NaN \n",
1977
+ "Macedonia Europe NaN NaN \n",
1978
+ "Monaco Europe NaN NaN \n",
1979
+ "San Marino Europe NaN NaN \n",
1980
+ "Vatican City Europe NaN NaN \n",
1981
+ "Antigua and Barbuda North America NaN NaN \n",
1982
+ "Bahamas North America NaN NaN \n",
1983
+ "Barbados North America NaN NaN \n",
1984
+ "Dominica North America NaN NaN \n",
1985
+ "Grenada North America NaN NaN \n",
1986
+ "Saint Kitts and Nevis North America NaN NaN \n",
1987
+ "Saint Lucia North America NaN NaN \n",
1988
+ "Saint Vincent and the Grenadines North America NaN NaN \n",
1989
+ "US North America NaN NaN \n",
1990
+ "Fiji Oceania NaN NaN \n",
1991
+ "Kiribati Oceania NaN NaN \n",
1992
+ "Marshall Islands Oceania NaN NaN \n",
1993
+ "Micronesia Oceania NaN NaN \n",
1994
+ "Nauru Oceania NaN NaN \n",
1995
+ "Palau Oceania NaN NaN \n",
1996
+ "Papua New Guinea Oceania NaN NaN \n",
1997
+ "Samoa Oceania NaN NaN \n",
1998
+ "Solomon Islands Oceania NaN NaN \n",
1999
+ "Tonga Oceania NaN NaN \n",
2000
+ "Tuvalu Oceania NaN NaN \n",
2001
+ "Vanuatu Oceania NaN NaN \n",
2002
+ "\n",
2003
+ " Log GDP per capita Social support \\\n",
2004
+ "Country \n",
2005
+ "Burkina NaN NaN \n",
2006
+ "Cape Verde NaN NaN \n",
2007
+ "Congo NaN NaN \n",
2008
+ "Congo, Democratic Republic of NaN NaN \n",
2009
+ "Equatorial Guinea NaN NaN \n",
2010
+ "Eritrea NaN NaN \n",
2011
+ "Guinea-Bissau NaN NaN \n",
2012
+ "Sao Tome and Principe NaN NaN \n",
2013
+ "Seychelles NaN NaN \n",
2014
+ "Brunei NaN NaN \n",
2015
+ "Burma (Myanmar) NaN NaN \n",
2016
+ "East Timor NaN NaN \n",
2017
+ "Korea, North NaN NaN \n",
2018
+ "Korea, South NaN NaN \n",
2019
+ "Russian Federation NaN NaN \n",
2020
+ "Andorra NaN NaN \n",
2021
+ "CZ NaN NaN \n",
2022
+ "Liechtenstein NaN NaN \n",
2023
+ "Macedonia NaN NaN \n",
2024
+ "Monaco NaN NaN \n",
2025
+ "San Marino NaN NaN \n",
2026
+ "Vatican City NaN NaN \n",
2027
+ "Antigua and Barbuda NaN NaN \n",
2028
+ "Bahamas NaN NaN \n",
2029
+ "Barbados NaN NaN \n",
2030
+ "Dominica NaN NaN \n",
2031
+ "Grenada NaN NaN \n",
2032
+ "Saint Kitts and Nevis NaN NaN \n",
2033
+ "Saint Lucia NaN NaN \n",
2034
+ "Saint Vincent and the Grenadines NaN NaN \n",
2035
+ "US NaN NaN \n",
2036
+ "Fiji NaN NaN \n",
2037
+ "Kiribati NaN NaN \n",
2038
+ "Marshall Islands NaN NaN \n",
2039
+ "Micronesia NaN NaN \n",
2040
+ "Nauru NaN NaN \n",
2041
+ "Palau NaN NaN \n",
2042
+ "Papua New Guinea NaN NaN \n",
2043
+ "Samoa NaN NaN \n",
2044
+ "Solomon Islands NaN NaN \n",
2045
+ "Tonga NaN NaN \n",
2046
+ "Tuvalu NaN NaN \n",
2047
+ "Vanuatu NaN NaN \n",
2048
+ "\n",
2049
+ " Healthy life expectancy at birth \\\n",
2050
+ "Country \n",
2051
+ "Burkina NaN \n",
2052
+ "Cape Verde NaN \n",
2053
+ "Congo NaN \n",
2054
+ "Congo, Democratic Republic of NaN \n",
2055
+ "Equatorial Guinea NaN \n",
2056
+ "Eritrea NaN \n",
2057
+ "Guinea-Bissau NaN \n",
2058
+ "Sao Tome and Principe NaN \n",
2059
+ "Seychelles NaN \n",
2060
+ "Brunei NaN \n",
2061
+ "Burma (Myanmar) NaN \n",
2062
+ "East Timor NaN \n",
2063
+ "Korea, North NaN \n",
2064
+ "Korea, South NaN \n",
2065
+ "Russian Federation NaN \n",
2066
+ "Andorra NaN \n",
2067
+ "CZ NaN \n",
2068
+ "Liechtenstein NaN \n",
2069
+ "Macedonia NaN \n",
2070
+ "Monaco NaN \n",
2071
+ "San Marino NaN \n",
2072
+ "Vatican City NaN \n",
2073
+ "Antigua and Barbuda NaN \n",
2074
+ "Bahamas NaN \n",
2075
+ "Barbados NaN \n",
2076
+ "Dominica NaN \n",
2077
+ "Grenada NaN \n",
2078
+ "Saint Kitts and Nevis NaN \n",
2079
+ "Saint Lucia NaN \n",
2080
+ "Saint Vincent and the Grenadines NaN \n",
2081
+ "US NaN \n",
2082
+ "Fiji NaN \n",
2083
+ "Kiribati NaN \n",
2084
+ "Marshall Islands NaN \n",
2085
+ "Micronesia NaN \n",
2086
+ "Nauru NaN \n",
2087
+ "Palau NaN \n",
2088
+ "Papua New Guinea NaN \n",
2089
+ "Samoa NaN \n",
2090
+ "Solomon Islands NaN \n",
2091
+ "Tonga NaN \n",
2092
+ "Tuvalu NaN \n",
2093
+ "Vanuatu NaN \n",
2094
+ "\n",
2095
+ " Freedom to make life choices Generosity \\\n",
2096
+ "Country \n",
2097
+ "Burkina NaN NaN \n",
2098
+ "Cape Verde NaN NaN \n",
2099
+ "Congo NaN NaN \n",
2100
+ "Congo, Democratic Republic of NaN NaN \n",
2101
+ "Equatorial Guinea NaN NaN \n",
2102
+ "Eritrea NaN NaN \n",
2103
+ "Guinea-Bissau NaN NaN \n",
2104
+ "Sao Tome and Principe NaN NaN \n",
2105
+ "Seychelles NaN NaN \n",
2106
+ "Brunei NaN NaN \n",
2107
+ "Burma (Myanmar) NaN NaN \n",
2108
+ "East Timor NaN NaN \n",
2109
+ "Korea, North NaN NaN \n",
2110
+ "Korea, South NaN NaN \n",
2111
+ "Russian Federation NaN NaN \n",
2112
+ "Andorra NaN NaN \n",
2113
+ "CZ NaN NaN \n",
2114
+ "Liechtenstein NaN NaN \n",
2115
+ "Macedonia NaN NaN \n",
2116
+ "Monaco NaN NaN \n",
2117
+ "San Marino NaN NaN \n",
2118
+ "Vatican City NaN NaN \n",
2119
+ "Antigua and Barbuda NaN NaN \n",
2120
+ "Bahamas NaN NaN \n",
2121
+ "Barbados NaN NaN \n",
2122
+ "Dominica NaN NaN \n",
2123
+ "Grenada NaN NaN \n",
2124
+ "Saint Kitts and Nevis NaN NaN \n",
2125
+ "Saint Lucia NaN NaN \n",
2126
+ "Saint Vincent and the Grenadines NaN NaN \n",
2127
+ "US NaN NaN \n",
2128
+ "Fiji NaN NaN \n",
2129
+ "Kiribati NaN NaN \n",
2130
+ "Marshall Islands NaN NaN \n",
2131
+ "Micronesia NaN NaN \n",
2132
+ "Nauru NaN NaN \n",
2133
+ "Palau NaN NaN \n",
2134
+ "Papua New Guinea NaN NaN \n",
2135
+ "Samoa NaN NaN \n",
2136
+ "Solomon Islands NaN NaN \n",
2137
+ "Tonga NaN NaN \n",
2138
+ "Tuvalu NaN NaN \n",
2139
+ "Vanuatu NaN NaN \n",
2140
+ "\n",
2141
+ " Perceptions of corruption Positive affect \\\n",
2142
+ "Country \n",
2143
+ "Burkina NaN NaN \n",
2144
+ "Cape Verde NaN NaN \n",
2145
+ "Congo NaN NaN \n",
2146
+ "Congo, Democratic Republic of NaN NaN \n",
2147
+ "Equatorial Guinea NaN NaN \n",
2148
+ "Eritrea NaN NaN \n",
2149
+ "Guinea-Bissau NaN NaN \n",
2150
+ "Sao Tome and Principe NaN NaN \n",
2151
+ "Seychelles NaN NaN \n",
2152
+ "Brunei NaN NaN \n",
2153
+ "Burma (Myanmar) NaN NaN \n",
2154
+ "East Timor NaN NaN \n",
2155
+ "Korea, North NaN NaN \n",
2156
+ "Korea, South NaN NaN \n",
2157
+ "Russian Federation NaN NaN \n",
2158
+ "Andorra NaN NaN \n",
2159
+ "CZ NaN NaN \n",
2160
+ "Liechtenstein NaN NaN \n",
2161
+ "Macedonia NaN NaN \n",
2162
+ "Monaco NaN NaN \n",
2163
+ "San Marino NaN NaN \n",
2164
+ "Vatican City NaN NaN \n",
2165
+ "Antigua and Barbuda NaN NaN \n",
2166
+ "Bahamas NaN NaN \n",
2167
+ "Barbados NaN NaN \n",
2168
+ "Dominica NaN NaN \n",
2169
+ "Grenada NaN NaN \n",
2170
+ "Saint Kitts and Nevis NaN NaN \n",
2171
+ "Saint Lucia NaN NaN \n",
2172
+ "Saint Vincent and the Grenadines NaN NaN \n",
2173
+ "US NaN NaN \n",
2174
+ "Fiji NaN NaN \n",
2175
+ "Kiribati NaN NaN \n",
2176
+ "Marshall Islands NaN NaN \n",
2177
+ "Micronesia NaN NaN \n",
2178
+ "Nauru NaN NaN \n",
2179
+ "Palau NaN NaN \n",
2180
+ "Papua New Guinea NaN NaN \n",
2181
+ "Samoa NaN NaN \n",
2182
+ "Solomon Islands NaN NaN \n",
2183
+ "Tonga NaN NaN \n",
2184
+ "Tuvalu NaN NaN \n",
2185
+ "Vanuatu NaN NaN \n",
2186
+ "\n",
2187
+ " Negative affect \n",
2188
+ "Country \n",
2189
+ "Burkina NaN \n",
2190
+ "Cape Verde NaN \n",
2191
+ "Congo NaN \n",
2192
+ "Congo, Democratic Republic of NaN \n",
2193
+ "Equatorial Guinea NaN \n",
2194
+ "Eritrea NaN \n",
2195
+ "Guinea-Bissau NaN \n",
2196
+ "Sao Tome and Principe NaN \n",
2197
+ "Seychelles NaN \n",
2198
+ "Brunei NaN \n",
2199
+ "Burma (Myanmar) NaN \n",
2200
+ "East Timor NaN \n",
2201
+ "Korea, North NaN \n",
2202
+ "Korea, South NaN \n",
2203
+ "Russian Federation NaN \n",
2204
+ "Andorra NaN \n",
2205
+ "CZ NaN \n",
2206
+ "Liechtenstein NaN \n",
2207
+ "Macedonia NaN \n",
2208
+ "Monaco NaN \n",
2209
+ "San Marino NaN \n",
2210
+ "Vatican City NaN \n",
2211
+ "Antigua and Barbuda NaN \n",
2212
+ "Bahamas NaN \n",
2213
+ "Barbados NaN \n",
2214
+ "Dominica NaN \n",
2215
+ "Grenada NaN \n",
2216
+ "Saint Kitts and Nevis NaN \n",
2217
+ "Saint Lucia NaN \n",
2218
+ "Saint Vincent and the Grenadines NaN \n",
2219
+ "US NaN \n",
2220
+ "Fiji NaN \n",
2221
+ "Kiribati NaN \n",
2222
+ "Marshall Islands NaN \n",
2223
+ "Micronesia NaN \n",
2224
+ "Nauru NaN \n",
2225
+ "Palau NaN \n",
2226
+ "Papua New Guinea NaN \n",
2227
+ "Samoa NaN \n",
2228
+ "Solomon Islands NaN \n",
2229
+ "Tonga NaN \n",
2230
+ "Tuvalu NaN \n",
2231
+ "Vanuatu NaN "
2232
+ ]
2233
+ },
2234
+ "execution_count": 88,
2235
+ "metadata": {},
2236
+ "output_type": "execute_result"
2237
+ }
2238
+ ],
2239
+ "source": [
2240
+ "df3"
2241
+ ]
2242
+ },
2243
+ {
2244
+ "cell_type": "markdown",
2245
+ "id": "db01b828-d1b1-4708-b6bd-3b2dbed54746",
2246
+ "metadata": {},
2247
+ "source": [
2248
+ "> Note that I updated these in the spreadsheet manually with Excel because it was faster to do it by hand... I should go back when I have time to do it programmatically..."
2249
+ ]
2250
+ }
2251
+ ],
2252
+ "metadata": {
2253
+ "kernelspec": {
2254
+ "display_name": "Python 3 (ipykernel)",
2255
+ "language": "python",
2256
+ "name": "python3"
2257
+ },
2258
+ "language_info": {
2259
+ "codemirror_mode": {
2260
+ "name": "ipython",
2261
+ "version": 3
2262
+ },
2263
+ "file_extension": ".py",
2264
+ "mimetype": "text/x-python",
2265
+ "name": "python",
2266
+ "nbconvert_exporter": "python",
2267
+ "pygments_lexer": "ipython3",
2268
+ "version": "3.8.8"
2269
+ }
2270
+ },
2271
+ "nbformat": 4,
2272
+ "nbformat_minor": 5
2273
+ }
Assets/Countries/.ipynb_checkpoints/combined-countries-checkpoint.csv ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ,Country,year,Life Ladder,Log GDP per capita,Social support,Healthy life expectancy at birth,Freedom to make life choices,Generosity,Perceptions of corruption,Positive affect,Negative affect,Continent
2
+ 0,Zimbabwe,2020,3.159802198410034,7.828756809234619,0.7172426581382751,56.79999923706055,0.6433029770851135,-0.00869576446712017,0.7885227799415588,0.702572762966156,0.34573638439178467,Africa
3
+ 1,Benin,2020,4.407745838165283,8.10229206085205,0.5066360831260681,55.099998474121094,0.7831146717071533,-0.08348871022462845,0.5318836569786072,0.6085846424102783,0.3045124411582947,Africa
4
+ 2,United Kingdom,2020,6.798177242279053,10.625810623168945,0.9293532371520996,72.69999694824219,0.8846240043640137,0.20250841975212097,0.49020394682884216,0.758163571357727,0.2246551215648651,Europe
5
+ 3,Philippines,2020,5.079585075378418,9.061443328857422,0.7811403870582581,62.099998474121094,0.9320417046546936,-0.11554288119077682,0.7442836761474609,0.8035621047019958,0.3268890082836151,Asia
6
+ 4,Iraq,2020,4.785165309906006,9.16718578338623,0.7078474760055542,61.400001525878906,0.7002145648002625,-0.020748287439346313,0.8491087555885315,0.6444642543792725,0.5315389037132263,Asia
7
+ 5,Belgium,2020,6.838760852813721,10.770537376403809,0.9035586714744568,72.4000015258789,0.7669178247451782,-0.16378448903560638,0.6336267590522766,0.6465103030204773,0.2601887881755829,Europe
8
+ 6,Iran,2020,4.864528179168701,,0.7572186589241028,66.5999984741211,0.5995944738388062,,0.7099016904830933,0.5824205279350281,0.47024500370025635,Asia
9
+ 7,Poland,2020,6.139455318450928,10.371203422546387,0.9531717300415039,70.0999984741211,0.7674286961555481,-0.006559355650097132,0.7868736386299133,0.759842574596405,0.32893791794776917,Europe
10
+ 8,Portugal,2020,5.767792224884033,10.370820045471191,0.8749903440475464,72.80000305175781,0.9131307601928711,-0.23809020221233368,0.8671571612358093,0.6477688550949097,0.3828126788139343,Europe
11
+ 9,India,2020,4.225281238555908,8.70277214050293,0.616639256477356,60.900001525878906,0.9063913226127625,0.07482379674911499,0.7801240086555481,0.7524339556694031,0.3831625282764435,Asia
12
+ 10,Israel,2020,7.194928169250488,10.538053512573242,0.9590721726417542,73.69999694824219,0.831315815448761,-0.04937167465686798,0.7476390600204468,0.6213983297348022,0.2428257316350937,Asia
13
+ 11,Iceland,2020,7.575489521026611,10.824200630187988,0.9832860827445984,73.0,0.9486271739006042,0.16027399897575378,0.6440638899803162,0.8630176186561584,0.17179514467716217,Europe
14
+ 12,United Arab Emirates,2020,6.458392143249512,11.052889823913574,0.8267555832862854,67.5,0.942161500453949,0.060019660741090775,,0.7516599297523499,0.2984803020954132,Asia
15
+ 13,Hungary,2020,6.038049697875977,10.335147857666016,0.9434003829956055,68.4000015258789,0.7709680795669556,-0.12040461599826813,0.8361051082611084,0.7352383732795715,0.24005194008350372,Europe
16
+ 14,Hong Kong S.A.R. of China,2020,5.295341491699219,,0.8129429817199707,,0.7054522633552551,,0.3803512156009674,0.608647346496582,0.210313618183136,
17
+ 15,Bolivia,2020,5.559258937835693,8.997989654541016,0.8048108816146851,64.19999694824219,0.8770319223403931,-0.05376378819346428,0.8682082891464233,0.7898184657096863,0.3817911744117737,South America
18
+ 16,Russia,2020,5.495288848876953,10.162235260009766,0.8870201706886292,65.0999984741211,0.7144664525985718,-0.07061229646205902,0.8230475187301636,0.6452149748802185,0.18952153623104095,
19
+ 17,Saudi Arabia,2020,6.559588432312012,10.700662612915039,0.8902559280395508,66.9000015258789,0.8842201232910156,-0.11053171008825302,,0.7536076307296753,0.25119906663894653,Asia
20
+ 18,Ireland,2020,7.03493070602417,11.322803497314453,0.9603110551834106,72.5,0.8820982575416565,0.013816552236676216,0.3556327223777771,0.7966610193252563,0.24644726514816284,Europe
21
+ 19,Italy,2020,6.488356113433838,10.56257152557373,0.8898240327835083,74.0,0.7181554436683655,-0.14993725717067719,0.8440945744514465,0.6702133417129517,0.3110021650791168,Europe
22
+ 20,Ukraine,2020,5.2696757316589355,9.427873611450195,0.884686291217804,65.19999694824219,0.7842734456062317,0.1263442039489746,0.9456689953804016,0.6877206563949585,0.28473618626594543,Europe
23
+ 21,Kenya,2020,4.546584129333496,8.36528205871582,0.6737176179885864,61.29999923706055,0.7020344734191895,0.2599695920944214,0.8365160226821899,0.7334348559379578,0.2969804108142853,Africa
24
+ 22,Latvia,2020,6.229008674621582,10.299590110778809,0.9280121922492981,67.4000015258789,0.8201116919517517,-0.077660471200943,0.808821976184845,0.7136284112930298,0.20158237218856812,Europe
25
+ 23,Laos,2020,5.284390926361084,8.959955215454102,0.6603962779045105,59.5,0.9150282144546509,0.14143069088459015,0.7479977011680603,0.8216802477836609,0.3583492636680603,Asia
26
+ 24,Nigeria,2020,5.50294828414917,8.484203338623047,0.7392894625663757,50.5,0.713061511516571,0.09940405935049057,0.9127744436264038,0.7439777255058289,0.31588682532310486,Africa
27
+ 25,Austria,2020,7.213489055633545,10.851118087768555,0.924831211566925,73.5999984741211,0.9119098782539368,0.01103174313902855,0.4638301730155945,0.7693166136741638,0.20649965107440948,Europe
28
+ 26,Kyrgyzstan,2020,6.24958610534668,8.503411293029785,0.9022229909896851,64.69999694824219,0.9348853230476379,0.10286574065685272,0.9313175082206726,0.8030253648757935,0.25781306624412537,Asia
29
+ 27,North Macedonia,2020,5.053664207458496,9.690014839172363,0.7503741979598999,65.55988311767578,0.7872847318649292,0.13127434253692627,0.8774211406707764,0.6046268343925476,0.3651260733604431,
30
+ 28,Kosovo,2020,6.294414043426514,,0.7923744916915894,,0.8798375725746155,,0.9098938703536987,0.7262398600578308,0.20145803689956665,
31
+ 29,Norway,2020,7.290032386779785,11.042160034179688,0.9559799432754517,73.4000015258789,0.9645611047744751,0.07514853775501251,0.2710832953453064,0.823093831539154,0.2160339206457138,Europe
32
+ 30,United States,2020,7.028088092803955,11.000656127929688,0.9373698234558105,68.0999984741211,0.8504472970962524,0.03410335257649422,0.6781246066093445,0.7873719930648804,0.2954990267753601,
33
+ 31,Kazakhstan,2020,6.168269157409668,10.135335922241211,0.966448962688446,65.80000305175781,0.8721001148223877,-0.056175168603658676,0.6607988476753235,0.6841026544570923,0.15035991370677948,Asia
34
+ 32,Bahrain,2020,6.173175811767578,10.619903564453125,0.8477450609207153,69.69999694824219,0.9452325701713562,0.13244104385375977,,0.7897949814796448,0.29683545231819153,Asia
35
+ 33,Uruguay,2020,6.309681415557861,9.9371919631958,0.9210703372955322,69.19999694824219,0.9077619314193726,-0.08398690074682236,0.49100783467292786,0.8073509335517883,0.2646920680999756,South America
36
+ 34,Jordan,2020,4.093991756439209,9.149994850158691,0.7088398933410645,67.19999694824219,0.7785334587097168,-0.14982588589191437,,,,Asia
37
+ 35,Japan,2020,6.1179633140563965,10.579547882080078,0.8872491121292114,75.19999694824219,0.806036114692688,-0.2587452828884125,0.6086985468864441,0.7424694299697876,0.18646100163459778,Asia
38
+ 36,Bangladesh,2020,5.27998685836792,8.47219467163086,0.7393379211425781,65.30000305175781,0.7774671912193298,-0.008851290680468082,0.7416591644287109,0.5823808312416077,0.33170878887176514,Asia
39
+ 37,Ivory Coast,2020,5.256503582000732,8.564923286437988,0.6131063103675842,50.70000076293945,0.7699980139732361,0.015563689172267914,0.7766872644424438,0.6926469206809998,0.3399190902709961,Africa
40
+ 38,Bosnia and Herzegovina,2020,5.5158162117004395,9.583344459533691,0.8985186815261841,68.4000015258789,0.740250825881958,0.13795417547225952,0.9160521626472473,0.6442373394966125,0.3254123032093048,Europe
41
+ 39,Greece,2020,5.787615776062012,10.214579582214355,0.7785365581512451,72.80000305175781,0.5646136403083801,-0.2408064603805542,0.7643245458602905,0.6844578385353088,0.32168421149253845,Europe
42
+ 40,Australia,2020,7.1373677253723145,10.75986385345459,0.9365170001983643,74.19999694824219,0.9052829742431641,0.21003030240535736,0.49109482765197754,0.7691817283630371,0.20507767796516418,Oceania
43
+ 41,Croatia,2020,6.507992267608643,10.165817260742188,0.9229134917259216,71.4000015258789,0.8366576433181763,-0.06296810507774353,0.9609392881393433,0.7427805066108704,0.28560975193977356,Europe
44
+ 42,Tunisia,2020,4.73081111907959,9.230624198913574,0.7190132141113281,67.5,0.6677581071853638,-0.20181423425674438,0.877354085445404,0.5846338868141174,0.43877434730529785,Africa
45
+ 43,Spain,2020,6.502175331115723,10.488059043884277,0.934934675693512,75.0,0.7832565307617188,-0.12061331421136856,0.7299774885177612,0.6861776113510132,0.31661710143089294,Europe
46
+ 44,Denmark,2020,7.514631271362305,10.909995079040527,0.9473713636398315,73.0,0.9379318356513977,0.05229302495718002,0.2138417512178421,0.8176636695861816,0.2271018922328949,Europe
47
+ 45,Cameroon,2020,5.241077899932861,8.174633979797363,0.7200466394424438,54.29999923706055,0.6745091676712036,0.049266181886196136,0.8365172147750854,0.6296146512031555,0.3864789605140686,Africa
48
+ 46,Czech Republic,2020,6.897091388702393,10.530134201049805,0.9640536904335022,71.30000305175781,0.9064220190048218,-0.1270223706960678,0.8836995959281921,0.8320576548576355,0.29044169187545776,
49
+ 47,Cyprus,2020,6.259810447692871,,0.8055593967437744,74.0999984741211,0.7627823352813721,,0.8162317276000977,0.7588630318641663,0.28352245688438416,Europe
50
+ 48,Sweden,2020,7.314341068267822,10.83790397644043,0.9355823397636414,72.80000305175781,0.9511815905570984,0.09081844985485077,0.20344014465808868,0.7663760781288147,0.2219332903623581,Europe
51
+ 49,Canada,2020,7.024904727935791,10.729514122009277,0.930610716342926,74.0,0.8868921995162964,0.049636855721473694,0.43401235342025757,0.7959487438201904,0.30667373538017273,North America
52
+ 50,South Korea,2020,5.79269552230835,10.64807415008545,0.8079522848129272,74.19999694824219,0.711480438709259,-0.1058678925037384,0.6646940112113953,0.6395556926727295,0.2470596581697464,
53
+ 51,Switzerland,2020,7.508435249328613,11.080892562866211,0.9463164806365967,74.69999694824219,0.917343258857727,-0.06350205838680267,0.2803671360015869,0.7687047123908997,0.19322898983955383,Europe
54
+ 52,Thailand,2020,5.884544372558594,9.769243240356445,0.8667026162147522,67.5999984741211,0.8404632806777954,0.2730555832386017,0.9183400273323059,0.7832698822021484,0.32616856694221497,Asia
55
+ 53,Taiwan Province of China,2020,6.751067638397217,,0.9008325338363647,,0.7988347411155701,,0.7105674147605896,0.8453933596611023,0.08273695409297943,
56
+ 54,Colombia,2020,5.709175109863281,9.495491027832031,0.7970352172851562,68.30000305175781,0.8401861190795898,-0.0846422091126442,0.807964026927948,0.7951326966285706,0.3401585817337036,South America
57
+ 55,Tajikistan,2020,5.373398780822754,8.08035659790039,0.7897445559501648,64.69999694824219,,-0.04046706482768059,0.5497864484786987,0.7488976120948792,0.3441612720489502,Asia
58
+ 56,Tanzania,2020,3.785684108734131,7.881270408630371,0.7398170828819275,58.5,0.83034348487854,0.29527199268341064,0.5206316709518433,0.6855331063270569,0.2711179256439209,Africa
59
+ 57,China,2020,5.771064758300781,9.701754570007324,0.808334469795227,69.9000015258789,0.8911229968070984,-0.1032143384218216,,0.789345383644104,0.24491822719573975,Asia
60
+ 58,Dominican Republic,2020,5.168409824371338,9.802446365356445,0.8061176538467407,66.4000015258789,0.8346429467201233,-0.1278340369462967,0.6361165642738342,0.7338669300079346,0.3139283061027527,North America
61
+ 59,Cambodia,2020,4.3769850730896,8.36193561553955,0.7244226336479187,62.400001525878906,0.9630754590034485,0.052429765462875366,0.8630539774894714,0.8779535293579102,0.3898516297340393,Asia
62
+ 60,Ghana,2020,5.319483280181885,8.589605331420898,0.6427033543586731,58.0,0.8237200379371643,0.19963206350803375,0.8470249176025391,0.7127659320831299,0.2527284324169159,Africa
63
+ 61,Slovakia,2020,6.519098281860352,10.331512451171875,0.9541599750518799,69.5,0.7618966102600098,-0.07487351447343826,0.9005336761474609,0.7635828852653503,0.27444788813591003,Europe
64
+ 62,Serbia,2020,6.04154634475708,9.788259506225586,0.8521018624305725,69.0,0.8434798717498779,0.14940130710601807,0.8244724869728088,0.6028461456298828,0.3575802743434906,Europe
65
+ 63,Uganda,2020,4.640909671783447,7.684450149536133,0.8004611730575562,56.5,0.6874821186065674,0.14711755514144897,0.8775872588157654,0.698948860168457,0.42470666766166687,Africa
66
+ 64,Germany,2020,7.3118977546691895,10.83349895477295,0.9050804972648621,72.80000305175781,0.8643560409545898,-0.06004804000258446,0.4240887761116028,0.7595943212509155,0.20592711865901947,Europe
67
+ 65,Georgia,2020,5.123143196105957,9.569304466247559,0.7183459401130676,64.0999984741211,0.7643523812294006,-0.22112546861171722,0.5827347040176392,0.6108949184417725,0.2945120632648468,Europe
68
+ 66,Brazil,2020,6.109717845916748,9.522140502929688,0.8308321237564087,66.80000305175781,0.7862350940704346,-0.05282001942396164,0.7287722229957581,0.6920238733291626,0.3891385495662689,South America
69
+ 67,France,2020,6.714111804962158,10.643280029296875,0.9473540186882019,74.19999694824219,0.8233863115310669,-0.16896052658557892,0.5646405816078186,0.731813907623291,0.23095043003559113,Europe
70
+ 68,Bulgaria,2020,5.597723007202148,9.990657806396484,0.9162423610687256,67.19999694824219,0.8182247877120972,-0.004322313703596592,0.9006329774856567,0.7058346271514893,0.22135105729103088,Europe
71
+ 69,Finland,2020,7.889349937438965,10.750446319580078,0.9616207480430603,72.0999984741211,0.9624236822128296,-0.11553198844194412,0.16363589465618134,0.7442921996116638,0.19289757311344147,Europe
72
+ 70,Ecuador,2020,5.354461669921875,9.243865013122559,0.8040085434913635,69.0999984741211,0.8285115361213684,-0.15709003806114197,0.8547804951667786,0.7899407148361206,0.4160279631614685,South America
73
+ 71,Ethiopia,2020,4.549219608306885,7.710982799530029,0.8231375813484192,59.5,0.768694281578064,0.18849685788154602,0.7838224172592163,0.6693886518478394,0.25151434540748596,Africa
74
+ 72,Slovenia,2020,6.462076187133789,10.477869987487793,0.9534375071525574,71.69999694824219,0.9584425687789917,-0.08135689049959183,0.7965574860572815,0.6099492311477661,0.3138525187969208,Europe
75
+ 73,Estonia,2020,6.452563762664795,10.458588600158691,0.9577704668045044,69.0,0.9542005658149719,-0.08227915316820145,0.39783477783203125,0.8069238066673279,0.1876794993877411,Europe
76
+ 74,El Salvador,2020,5.4619269371032715,9.018845558166504,0.6956243515014648,66.69999694824219,0.9239448308944702,-0.1264744997024536,0.5830363631248474,0.8389042019844055,0.32943978905677795,North America
77
+ 75,Turkey,2020,4.861554145812988,10.219083786010742,0.8567302227020264,67.5999984741211,0.5103858709335327,-0.11088898777961731,0.7744171619415283,0.38429245352745056,0.4403873085975647,Asia
78
+ 76,South Africa,2020,4.946800708770752,9.332463264465332,0.8910503387451172,57.29999923706055,0.7569462656974792,-0.014951311983168125,0.9124072194099426,0.8203377723693848,0.29427647590637207,Africa
79
+ 77,Egypt,2020,4.4723968505859375,9.382726669311523,0.6727254986763,62.29999923706055,0.7695503234863281,-0.1123419776558876,,0.5989086627960205,0.442033588886261,Africa
80
+ 78,Venezuela,2020,4.573829650878906,,0.8052242398262024,66.9000015258789,0.6118146181106567,,0.81131911277771,0.7223914265632629,0.396250456571579,South America
81
+ 79,Chile,2020,6.1506428718566895,10.0201416015625,0.8884122967720032,70.0999984741211,0.7813835740089417,0.03299075737595558,0.8118188381195068,0.8146027326583862,0.3360286056995392,South America
82
+ 80,Lithuania,2020,6.391378879547119,10.503606796264648,0.952544093132019,68.5,0.8240605592727661,-0.12178131192922592,0.829204797744751,0.6602295637130737,0.20191200077533722,Europe
83
+ 81,Moldova,2020,5.811628818511963,9.462109565734863,0.8740617632865906,66.4000015258789,0.8590832352638245,-0.05827857926487923,0.9414389729499817,0.7272245287895203,0.2678360641002655,Europe
84
+ 82,Netherlands,2020,7.504447937011719,10.900500297546387,0.9439561367034912,72.5,0.9345226287841797,0.15129804611206055,0.2806045114994049,0.7839906215667725,0.2465113252401352,Europe
85
+ 83,Mongolia,2020,6.011364936828613,9.395559310913086,0.9177891612052917,62.70000076293945,0.7184910178184509,0.1413574516773224,0.8428276777267456,0.6364434957504272,0.25998303294181824,Asia
86
+ 84,Mauritius,2020,6.015300273895264,9.972017288208008,0.8925659656524658,67.0,0.8425980806350708,-0.03669271990656853,0.771790087223053,0.7669844627380371,0.1384017914533615,Africa
87
+ 85,Mexico,2020,5.964221000671387,9.78218936920166,0.7788162231445312,68.9000015258789,0.8733469843864441,-0.1193898618221283,0.778165876865387,0.8101091384887695,0.29155611991882324,North America
88
+ 86,New Zealand,2020,7.257381916046143,10.600457191467285,0.9519907832145691,73.5999984741211,0.9181545972824097,0.1252596527338028,0.2827679514884949,0.8494150042533875,0.20854105055332184,Oceania
89
+ 87,Namibia,2020,4.451010227203369,9.10413932800293,0.7405703067779541,57.099998474121094,0.6656819581985474,-0.10388018190860748,0.8103548288345337,0.6479195356369019,0.24754208326339722,Africa
90
+ 88,Myanmar,2020,4.431364059448242,8.553914070129395,0.7957632541656494,59.599998474121094,0.8248707056045532,0.4702581763267517,0.6467021107673645,0.7997491955757141,0.2892182171344757,
91
+ 89,Malta,2020,6.156822681427002,,0.9379202723503113,72.19999694824219,0.9306004643440247,,0.674626350402832,0.6014958620071411,0.41091322898864746,Europe
92
+ 90,Zambia,2020,4.837992191314697,8.11658000946045,0.7668716311454773,56.29999923706055,0.7504224181175232,0.056029193103313446,0.8097497820854187,0.691082239151001,0.34452593326568604,Africa
93
+ 91,Argentina,2020,5.900567054748535,9.850449562072754,0.8971038460731506,69.19999694824219,0.8233916163444519,-0.12235432863235474,0.8157804608345032,0.7635238766670227,0.34249693155288696,South America
94
+ 92,Morocco,2020,4.80261754989624,8.870917320251465,0.5525200963020325,66.5,0.8189952373504639,-0.22857755422592163,0.8027402758598328,0.5871824026107788,0.2564311921596527,Africa
95
+ 93,Albania,2020,5.364909648895264,9.497251510620117,0.7101150155067444,69.30000305175781,0.7536710500717163,0.006968025118112564,0.8913589715957642,0.6786612272262573,0.26506611704826355,Europe
96
+ 94,Montenegro,2020,5.72216272354126,9.912668228149414,0.8871294856071472,68.9000015258789,0.8018550872802734,0.059815771877765656,0.8446871042251587,0.6032826900482178,0.41137781739234924,Europe
97
+ 95,Guinea,2019,4.767684459686279,7.849340438842773,0.6551241874694824,55.5,0.691399097442627,0.09681724011898041,0.7555854916572571,0.6846469044685364,0.4733884334564209,Africa
98
+ 96,Yemen,2019,4.19691276550293,,0.8700428009033203,57.5,0.6513082385063171,,0.7982282638549805,0.5428059101104736,0.2130432277917862,Asia
99
+ 97,Guatemala,2019,6.2621750831604,9.063875198364258,0.774074375629425,65.0999984741211,0.9006763100624084,-0.06230298802256584,0.7725779414176941,0.859412670135498,0.3107892572879791,North America
100
+ 98,Malaysia,2019,5.427954196929932,10.252403259277344,0.8424988389015198,67.19999694824219,0.9157786965370178,0.12332413345575333,0.7819439172744751,0.8341774940490723,0.17607168853282928,Asia
101
+ 99,Rwanda,2019,3.2681522369384766,7.7080607414245605,0.48945823311805725,61.70000076293945,0.868999183177948,0.06406588107347488,0.16797089576721191,0.7360679507255554,0.4176676869392395,Africa
102
+ 100,Sri Lanka,2019,4.21329927444458,9.478693962097168,0.8149391412734985,67.4000015258789,0.8242773413658142,0.051186613738536835,0.86334228515625,0.8163903951644897,0.3145427107810974,Asia
103
+ 101,Malawi,2019,3.869123697280884,6.965763092041016,0.5489560961723328,58.29999923706055,0.7648642063140869,0.003596819471567869,0.680247962474823,0.5366970300674438,0.348162442445755,Africa
104
+ 102,Nepal,2019,5.448724746704102,8.136457443237305,0.772273063659668,64.5999984741211,0.790347695350647,0.16697579622268677,0.7118424773216248,0.5357981324195862,0.35710030794143677,Asia
105
+ 103,Swaziland,2019,4.396114826202393,9.069709777832031,0.759097695350647,51.27039337158203,0.5966824293136597,-0.19073791801929474,0.7235077619552612,0.7776272892951965,0.27959516644477844,Africa
106
+ 104,Romania,2019,6.129942417144775,10.305913925170898,0.841905951499939,67.5,0.8475431799888611,-0.22142210602760315,0.9541307091712952,0.6974433660507202,0.24365922808647156,Europe
107
+ 105,Senegal,2019,5.488736629486084,8.130020141601562,0.6876140832901001,60.0,0.7588417530059814,-0.01880391500890255,0.7956734299659729,0.7889730334281921,0.3319258391857147,Africa
108
+ 106,Honduras,2019,5.930051326751709,8.653117179870605,0.7971483469009399,67.4000015258789,0.8461900353431702,0.06270892173051834,0.8149629235267639,0.8499549627304077,0.27888208627700806,North America
109
+ 107,Mali,2019,4.987991809844971,7.752494812011719,0.7545580863952637,52.20000076293945,0.6704050898551941,-0.03785175830125809,0.846340000629425,0.7115226984024048,0.35776451230049133,Africa
110
+ 108,Mauritania,2019,4.152619361877441,8.555842399597168,0.7981019616127014,57.29999923706055,0.6275051832199097,-0.10185665637254715,0.7428902983665466,0.6918314695358276,0.2597385048866272,Africa
111
+ 109,Turkmenistan,2019,5.474299907684326,9.65118408203125,0.9815017580986023,62.599998474121094,0.8915268778800964,0.2848806381225586,,0.5099145174026489,0.18334324657917023,Asia
112
+ 110,Burkina Faso,2019,4.7408928871154785,7.691488265991211,0.6831023693084717,54.400001525878906,0.6775468587875366,-0.004089894238859415,0.7293965816497803,0.6909258961677551,0.3647753894329071,
113
+ 111,Algeria,2019,4.744627475738525,9.336946487426758,0.8032586574554443,66.0999984741211,0.3850834369659424,0.005086520221084356,0.740609347820282,0.5849443078041077,0.21519775688648224,Africa
114
+ 112,Botswana,2019,3.4710848331451416,9.785069465637207,0.7736672163009644,59.599998474121094,0.8325426578521729,-0.23900093138217926,0.792079508304596,0.7117963433265686,0.2727217674255371,Africa
115
+ 113,Sierra Leone,2019,3.4473814964294434,7.449131965637207,0.6107797622680664,52.400001525878906,0.7177695631980896,0.07405570149421692,0.8738614320755005,0.5133752226829529,0.43813446164131165,Africa
116
+ 114,Mozambique,2019,4.932132720947266,7.154966831207275,0.742303729057312,55.20000076293945,0.8698102235794067,0.07274501770734787,0.6819004416465759,0.5872747302055359,0.384122759103775,Africa
117
+ 115,Singapore,2019,6.378359794616699,11.485980033874512,0.9249183535575867,77.0999984741211,0.9380417466163635,0.027229677885770798,0.06961960345506668,0.7225980162620544,0.13806915283203125,Asia
118
+ 116,Gambia,2019,5.1636271476745605,7.699349880218506,0.6938701272010803,55.29999923706055,0.6765952706336975,0.4101804792881012,0.7981081008911133,0.7728161811828613,0.40072327852249146,Africa
119
+ 117,Gabon,2019,4.914393424987793,9.607087135314941,0.7630516886711121,60.20000076293945,0.736349880695343,-0.20251981914043427,0.8462542295455933,0.6927024126052856,0.4129609763622284,Africa
120
+ 118,Indonesia,2019,5.346512794494629,9.376888275146484,0.8019180297851562,62.29999923706055,0.8658591508865356,0.5553480386734009,0.8607847690582275,0.8767140507698059,0.3017027974128723,Asia
121
+ 119,Azerbaijan,2019,5.173389434814453,9.575250625610352,0.886756420135498,65.80000305175781,0.8542485237121582,-0.2141629159450531,0.4572606682777405,0.6425468325614929,0.16392025351524353,Europe
122
+ 120,Chad,2019,4.250799179077148,7.364943981170654,0.6404520869255066,48.70000076293945,0.5372456908226013,0.05500093847513199,0.8322834968566895,0.5872111916542053,0.46006128191947937,Africa
123
+ 121,Liberia,2019,5.121460914611816,7.263903617858887,0.7124737501144409,56.900001525878906,0.7058745622634888,0.050611626356840134,0.8284689784049988,0.635608971118927,0.3891325891017914,Africa
124
+ 122,Libya,2019,5.330222129821777,9.627349853515625,0.826719343662262,62.29999923706055,0.7619643211364746,-0.07267285138368607,0.6864129900932312,0.7087408900260925,0.4007374346256256,Africa
125
+ 123,Pakistan,2019,4.442717552185059,8.453290939331055,0.6172957420349121,58.900001525878906,0.6846755743026733,0.12372947484254837,0.775998055934906,0.5810673832893372,0.4242400825023651,Asia
126
+ 124,Armenia,2019,5.488086700439453,9.521769523620605,0.7816038727760315,67.19999694824219,0.8443241119384766,-0.17236898839473724,0.583472728729248,0.5982378125190735,0.43046340346336365,Europe
127
+ 125,Comoros,2019,4.608616352081299,8.033134460449219,0.6320129632949829,57.5,0.5382615327835083,0.0772530809044838,0.7622324824333191,0.7362217307090759,0.33616289496421814,Africa
128
+ 126,Afghanistan,2019,2.375091791152954,7.6972479820251465,0.41997286677360535,52.400001525878906,0.3936561644077301,-0.10845886915922165,0.9238491058349609,0.35138705372810364,0.5024737119674683,Asia
129
+ 127,Palestinian Territories,2019,4.482537269592285,,0.832550048828125,,0.653488278388977,,0.8292827606201172,0.6251764297485352,0.3996722996234894,
130
+ 128,Nicaragua,2019,6.112545013427734,8.59546947479248,0.873863935470581,67.80000305175781,0.8826784491539001,0.029247265309095383,0.6219817399978638,0.835423469543457,0.33701297640800476,North America
131
+ 129,Niger,2019,5.003544330596924,7.105849266052246,0.6769587397575378,54.0,0.8313618898391724,0.025959890335798264,0.7288551330566406,0.8159151673316956,0.3044382631778717,Africa
132
+ 130,Lebanon,2019,4.024219512939453,9.596782684326172,0.8659685254096985,67.5999984741211,0.44700148701667786,-0.08108239620923996,0.890415608882904,0.32168975472450256,0.4944990277290344,Asia
133
+ 131,Lesotho,2019,3.5117805004119873,7.925776958465576,0.7897053956985474,48.70000076293945,0.7163135409355164,-0.13053622841835022,0.9149514436721802,0.7348799109458923,0.27342551946640015,Africa
134
+ 132,Uzbekistan,2019,6.154049396514893,8.853480339050293,0.9152759313583374,65.4000015258789,0.9702945351600647,0.3042975962162018,0.5111968517303467,0.8448085188865662,0.21974551677703857,Asia
135
+ 133,North Cyprus,2019,5.466615200042725,,0.8032945394515991,,0.7927346229553223,,0.6400588750839233,0.49369287490844727,0.2964111268520355,
136
+ 134,Kuwait,2019,6.106119632720947,10.816696166992188,0.8415197730064392,66.9000015258789,0.8672738075256348,-0.10416107624769211,,0.6953627467155457,0.3028763234615326,Asia
137
+ 135,Congo (Brazzaville),2019,5.21262264251709,8.101092338562012,0.624768078327179,58.5,0.6864519715309143,-0.04605123773217201,0.740589439868927,0.6452539563179016,0.40504083037376404,
138
+ 136,Peru,2019,5.9993815422058105,9.46093463897705,0.8090759515762329,68.4000015258789,0.8148059248924255,-0.1297357827425003,0.8736019134521484,0.820448100566864,0.3749854862689972,South America
139
+ 137,Vietnam,2019,5.467451095581055,8.992330551147461,0.8475921154022217,68.0999984741211,0.9524691700935364,-0.12553076446056366,0.7878892421722412,0.7511599063873291,0.18561019003391266,Asia
140
+ 138,Togo,2019,4.1794939041137695,7.375211238861084,0.5387021899223328,55.099998474121094,0.6174197793006897,0.06477482616901398,0.7366750240325928,0.5902292728424072,0.4438698887825012,Africa
141
+ 139,Belarus,2019,5.821453094482422,9.860038757324219,0.9167404770851135,66.4000015258789,0.656933605670929,-0.18593330681324005,0.5459047555923462,0.5908505916595459,0.18982140719890594,Europe
142
+ 140,Madagascar,2019,4.33908748626709,7.4062371253967285,0.7006101012229919,59.5,0.5495352149009705,-0.012468654662370682,0.7199826836585999,0.7231946587562561,0.3039596676826477,Africa
143
+ 141,Costa Rica,2019,6.997618675231934,9.885446548461914,0.9060774445533752,71.5,0.9268301129341125,-0.14599433541297913,0.83562833070755,0.8483476042747498,0.3033272325992584,North America
144
+ 142,Luxembourg,2019,7.40401554107666,11.648168563842773,0.9121045470237732,72.5999984741211,0.930321216583252,-0.04505761340260506,0.38959842920303345,0.7891863584518433,0.21163980662822723,Europe
145
+ 143,Panama,2019,6.0859551429748535,10.356431007385254,0.8857213854789734,69.69999694824219,0.882961094379425,-0.1989849954843521,0.8688275218009949,0.877561628818512,0.2435666024684906,North America
146
+ 144,Paraguay,2019,5.652625560760498,9.44814395904541,0.8924871683120728,65.9000015258789,0.8760526180267334,0.02811283804476261,0.8817861080169678,0.857724130153656,0.2751867175102234,South America
147
+ 145,Jamaica,2019,6.309238910675049,9.186201095581055,0.8778144717216492,67.5,0.8906708359718323,-0.13679705560207367,0.8853300213813782,0.7520411014556885,0.1952841430902481,North America
148
+ 146,Maldives,2018,5.197574615478516,9.8259859085083,0.9133150577545166,70.5999984741211,0.8547592759132385,0.0239978339523077,,,,Asia
149
+ 147,Haiti,2018,3.6149280071258545,7.477138042449951,0.5379759073257446,55.70000076293945,0.5914683938026428,0.4215203523635864,0.7204447388648987,0.5841132998466492,0.3587200343608856,North America
150
+ 148,Burundi,2018,3.775283098220825,6.635322093963623,0.48471522331237793,53.400001525878906,0.6463986039161682,-0.023876165971159935,0.5986076593399048,0.6664415001869202,0.3627665936946869,Africa
151
+ 149,Congo (Kinshasa),2017,4.311033248901367,6.965845584869385,0.6696884036064148,52.900001525878906,0.704239547252655,0.06837817281484604,0.8091818690299988,0.5505259037017822,0.40426206588745117,
152
+ 150,Central African Republic,2017,3.4758620262145996,6.816519260406494,0.31958913803100586,45.20000076293945,0.6452523469924927,0.07278610020875931,0.8895660042762756,0.6138651967048645,0.5993354916572571,Africa
153
+ 151,Trinidad and Tobago,2017,6.191859722137451,10.182920455932617,0.9160290360450745,63.5,0.8591404557228088,0.014855396002531052,0.911336362361908,0.8464670777320862,0.24809880554676056,North America
154
+ 152,South Sudan,2017,2.816622495651245,,0.556822657585144,51.0,0.4560110867023468,,0.7612696290016174,0.5856021642684937,0.5173637866973877,Africa
155
+ 153,Somalia,2016,4.667941093444824,,0.5944165587425232,50.0,0.9173228144645691,,0.440801739692688,0.8914231657981873,0.19328223168849945,Africa
156
+ 154,Syria,2015,3.4619128704071045,8.441536903381348,0.46391287446022034,55.20000076293945,0.44827085733413696,0.044834915548563004,0.685236930847168,0.36943960189819336,0.64258873462677,Asia
157
+ 155,Qatar,2015,6.3745293617248535,11.485614776611328,,68.30000305175781,,,,,,Asia
158
+ 156,Bhutan,2015,5.082128524780273,9.218923568725586,0.8475744128227234,60.20000076293945,0.8301015496253967,0.2774123549461365,0.6339557766914368,0.8096414804458618,0.3115893006324768,Asia
159
+ 157,Sudan,2014,4.138672828674316,8.317068099975586,0.8106155395507812,55.119998931884766,0.3900958001613617,-0.06339464336633682,0.793785035610199,0.5408450365066528,0.3027249872684479,Africa
160
+ 158,Angola,2014,3.7948379516601562,9.016735076904297,0.7546154856681824,54.599998474121094,0.3745415508747101,-0.167722687125206,0.8340756297111511,0.5785171389579773,0.36786413192749023,Africa
161
+ 159,Belize,2014,5.955646514892578,8.883127212524414,0.7569324970245361,62.220001220703125,0.8735690712928772,0.021995628252625465,0.7821053862571716,0.7549773454666138,0.2816044092178345,North America
162
+ 160,Suriname,2012,6.269286632537842,9.79708480834961,0.7972620725631714,62.2400016784668,0.8854884505271912,-0.07717316597700119,0.7512828707695007,0.7642226815223694,0.2503649890422821,South America
163
+ 161,Somaliland region,2012,5.057314395904541,,0.786291241645813,,0.7582190036773682,,0.3338317275047302,0.7351891398429871,0.15242822468280792,
164
+ 162,Oman,2011,6.852982044219971,10.382461547851562,,65.5,0.9162930250167847,0.02490849234163761,,,0.2951641082763672,Asia
165
+ 163,Djibouti,2011,4.3691935539245605,7.880099296569824,0.6329732537269592,54.70000076293945,0.7464394569396973,-0.05731891468167305,0.5189301371574402,0.5793028473854065,0.1805926263332367,Africa
166
+ 164,Guyana,2007,5.992826461791992,8.77328872680664,0.8487651944160461,57.2599983215332,0.6940056681632996,0.11003703624010086,0.8355690836906433,0.7675405740737915,0.29641976952552795,South America
167
+ 165,Cuba,2006,5.417868614196777,,0.9695951342582703,68.44000244140625,0.28145793080329895,,,0.6467117667198181,0.27660152316093445,North America
Assets/Countries/.ipynb_checkpoints/countries-checkpoint.csv ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Country,Continent
2
+ Algeria,Africa
3
+ Angola,Africa
4
+ Benin,Africa
5
+ Botswana,Africa
6
+ Burkina,Africa
7
+ Burundi,Africa
8
+ Cameroon,Africa
9
+ Cape Verde,Africa
10
+ Central African Republic,Africa
11
+ Chad,Africa
12
+ Comoros,Africa
13
+ Congo,Africa
14
+ "Congo, Democratic Republic of",Africa
15
+ Djibouti,Africa
16
+ Egypt,Africa
17
+ Equatorial Guinea,Africa
18
+ Eritrea,Africa
19
+ Ethiopia,Africa
20
+ Gabon,Africa
21
+ Gambia,Africa
22
+ Ghana,Africa
23
+ Guinea,Africa
24
+ Guinea-Bissau,Africa
25
+ Ivory Coast,Africa
26
+ Kenya,Africa
27
+ Lesotho,Africa
28
+ Liberia,Africa
29
+ Libya,Africa
30
+ Madagascar,Africa
31
+ Malawi,Africa
32
+ Mali,Africa
33
+ Mauritania,Africa
34
+ Mauritius,Africa
35
+ Morocco,Africa
36
+ Mozambique,Africa
37
+ Namibia,Africa
38
+ Niger,Africa
39
+ Nigeria,Africa
40
+ Rwanda,Africa
41
+ Sao Tome and Principe,Africa
42
+ Senegal,Africa
43
+ Seychelles,Africa
44
+ Sierra Leone,Africa
45
+ Somalia,Africa
46
+ South Africa,Africa
47
+ South Sudan,Africa
48
+ Sudan,Africa
49
+ Swaziland,Africa
50
+ Tanzania,Africa
51
+ Togo,Africa
52
+ Tunisia,Africa
53
+ Uganda,Africa
54
+ Zambia,Africa
55
+ Zimbabwe,Africa
56
+ Afghanistan,Asia
57
+ Bahrain,Asia
58
+ Bangladesh,Asia
59
+ Bhutan,Asia
60
+ Brunei,Asia
61
+ Burma (Myanmar),Asia
62
+ Cambodia,Asia
63
+ China,Asia
64
+ East Timor,Asia
65
+ India,Asia
66
+ Indonesia,Asia
67
+ Iran,Asia
68
+ Iraq,Asia
69
+ Israel,Asia
70
+ Japan,Asia
71
+ Jordan,Asia
72
+ Kazakhstan,Asia
73
+ "Korea, North",Asia
74
+ "Korea, South",Asia
75
+ Kuwait,Asia
76
+ Kyrgyzstan,Asia
77
+ Laos,Asia
78
+ Lebanon,Asia
79
+ Malaysia,Asia
80
+ Maldives,Asia
81
+ Mongolia,Asia
82
+ Nepal,Asia
83
+ Oman,Asia
84
+ Pakistan,Asia
85
+ Philippines,Asia
86
+ Qatar,Asia
87
+ Russian Federation,Asia
88
+ Saudi Arabia,Asia
89
+ Singapore,Asia
90
+ Sri Lanka,Asia
91
+ Syria,Asia
92
+ Tajikistan,Asia
93
+ Thailand,Asia
94
+ Turkey,Asia
95
+ Turkmenistan,Asia
96
+ United Arab Emirates,Asia
97
+ Uzbekistan,Asia
98
+ Vietnam,Asia
99
+ Yemen,Asia
100
+ Albania,Europe
101
+ Andorra,Europe
102
+ Armenia,Europe
103
+ Austria,Europe
104
+ Azerbaijan,Europe
105
+ Belarus,Europe
106
+ Belgium,Europe
107
+ Bosnia and Herzegovina,Europe
108
+ Bulgaria,Europe
109
+ Croatia,Europe
110
+ Cyprus,Europe
111
+ CZ,Europe
112
+ Denmark,Europe
113
+ Estonia,Europe
114
+ Finland,Europe
115
+ France,Europe
116
+ Georgia,Europe
117
+ Germany,Europe
118
+ Greece,Europe
119
+ Hungary,Europe
120
+ Iceland,Europe
121
+ Ireland,Europe
122
+ Italy,Europe
123
+ Latvia,Europe
124
+ Liechtenstein,Europe
125
+ Lithuania,Europe
126
+ Luxembourg,Europe
127
+ Macedonia,Europe
128
+ Malta,Europe
129
+ Moldova,Europe
130
+ Monaco,Europe
131
+ Montenegro,Europe
132
+ Netherlands,Europe
133
+ Norway,Europe
134
+ Poland,Europe
135
+ Portugal,Europe
136
+ Romania,Europe
137
+ San Marino,Europe
138
+ Serbia,Europe
139
+ Slovakia,Europe
140
+ Slovenia,Europe
141
+ Spain,Europe
142
+ Sweden,Europe
143
+ Switzerland,Europe
144
+ Ukraine,Europe
145
+ United Kingdom,Europe
146
+ Vatican City,Europe
147
+ Antigua and Barbuda,North America
148
+ Bahamas,North America
149
+ Barbados,North America
150
+ Belize,North America
151
+ Canada,North America
152
+ Costa Rica,North America
153
+ Cuba,North America
154
+ Dominica,North America
155
+ Dominican Republic,North America
156
+ El Salvador,North America
157
+ Grenada,North America
158
+ Guatemala,North America
159
+ Haiti,North America
160
+ Honduras,North America
161
+ Jamaica,North America
162
+ Mexico,North America
163
+ Nicaragua,North America
164
+ Panama,North America
165
+ Saint Kitts and Nevis,North America
166
+ Saint Lucia,North America
167
+ Saint Vincent and the Grenadines,North America
168
+ Trinidad and Tobago,North America
169
+ US,North America
170
+ Australia,Oceania
171
+ Fiji,Oceania
172
+ Kiribati,Oceania
173
+ Marshall Islands,Oceania
174
+ Micronesia,Oceania
175
+ Nauru,Oceania
176
+ New Zealand,Oceania
177
+ Palau,Oceania
178
+ Papua New Guinea,Oceania
179
+ Samoa,Oceania
180
+ Solomon Islands,Oceania
181
+ Tonga,Oceania
182
+ Tuvalu,Oceania
183
+ Vanuatu,Oceania
184
+ Argentina,South America
185
+ Bolivia,South America
186
+ Brazil,South America
187
+ Chile,South America
188
+ Colombia,South America
189
+ Ecuador,South America
190
+ Guyana,South America
191
+ Paraguay,South America
192
+ Peru,South America
193
+ Suriname,South America
194
+ Uruguay,South America
195
+ Venezuela,South America
Assets/Countries/Country-Data-Origin.md ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # Origin of the country data used in this project
2
+
3
+ I started by getting a list of countries on Github, from [
4
+ Daina Bouquin](https://github.com/dbouquin/IS_608/blob/master/NanosatDB_munging/Countries-Continents.csv), because it seemed relatively completey and contained continents. Then I started to think about secondary data that might be useful for exposing the bias in an algorithm and opted for the [World Happiness Report 2021](https://worldhappiness.report/ed/2021/#appendices-and-data). I added the continents to the countries in that file to ensure I could retain the initial categorization I used.
Assets/Countries/DataPanelWHR2021C2.xls ADDED
Binary file (434 kB). View file
 
Assets/Countries/clean-countries.ipynb ADDED
@@ -0,0 +1,2273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "daf46b53-319f-4973-9bb6-664135dd328e",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import pandas as pd, spacy, nltk, numpy as np, re, ssl"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 56,
16
+ "id": "3cae7a11-7696-40fc-967e-7ecafcb2b0da",
17
+ "metadata": {},
18
+ "outputs": [],
19
+ "source": [
20
+ "df = pd.read_excel(\"Assets/Countries/DataPanelWHR2021C2.xls\")"
21
+ ]
22
+ },
23
+ {
24
+ "cell_type": "code",
25
+ "execution_count": 57,
26
+ "id": "c1ebf3f3-1d38-4919-b60a-dc15e7bf907b",
27
+ "metadata": {},
28
+ "outputs": [
29
+ {
30
+ "data": {
31
+ "text/html": [
32
+ "<div>\n",
33
+ "<style scoped>\n",
34
+ " .dataframe tbody tr th:only-of-type {\n",
35
+ " vertical-align: middle;\n",
36
+ " }\n",
37
+ "\n",
38
+ " .dataframe tbody tr th {\n",
39
+ " vertical-align: top;\n",
40
+ " }\n",
41
+ "\n",
42
+ " .dataframe thead th {\n",
43
+ " text-align: right;\n",
44
+ " }\n",
45
+ "</style>\n",
46
+ "<table border=\"1\" class=\"dataframe\">\n",
47
+ " <thead>\n",
48
+ " <tr style=\"text-align: right;\">\n",
49
+ " <th></th>\n",
50
+ " <th>Country</th>\n",
51
+ " <th>year</th>\n",
52
+ " <th>Life Ladder</th>\n",
53
+ " <th>Log GDP per capita</th>\n",
54
+ " <th>Social support</th>\n",
55
+ " <th>Healthy life expectancy at birth</th>\n",
56
+ " <th>Freedom to make life choices</th>\n",
57
+ " <th>Generosity</th>\n",
58
+ " <th>Perceptions of corruption</th>\n",
59
+ " <th>Positive affect</th>\n",
60
+ " <th>Negative affect</th>\n",
61
+ " </tr>\n",
62
+ " </thead>\n",
63
+ " <tbody>\n",
64
+ " <tr>\n",
65
+ " <th>0</th>\n",
66
+ " <td>Afghanistan</td>\n",
67
+ " <td>2008</td>\n",
68
+ " <td>3.723590</td>\n",
69
+ " <td>7.370100</td>\n",
70
+ " <td>0.450662</td>\n",
71
+ " <td>50.799999</td>\n",
72
+ " <td>0.718114</td>\n",
73
+ " <td>0.167640</td>\n",
74
+ " <td>0.881686</td>\n",
75
+ " <td>0.517637</td>\n",
76
+ " <td>0.258195</td>\n",
77
+ " </tr>\n",
78
+ " <tr>\n",
79
+ " <th>1</th>\n",
80
+ " <td>Afghanistan</td>\n",
81
+ " <td>2009</td>\n",
82
+ " <td>4.401778</td>\n",
83
+ " <td>7.539972</td>\n",
84
+ " <td>0.552308</td>\n",
85
+ " <td>51.200001</td>\n",
86
+ " <td>0.678896</td>\n",
87
+ " <td>0.190099</td>\n",
88
+ " <td>0.850035</td>\n",
89
+ " <td>0.583926</td>\n",
90
+ " <td>0.237092</td>\n",
91
+ " </tr>\n",
92
+ " <tr>\n",
93
+ " <th>2</th>\n",
94
+ " <td>Afghanistan</td>\n",
95
+ " <td>2010</td>\n",
96
+ " <td>4.758381</td>\n",
97
+ " <td>7.646709</td>\n",
98
+ " <td>0.539075</td>\n",
99
+ " <td>51.599998</td>\n",
100
+ " <td>0.600127</td>\n",
101
+ " <td>0.120590</td>\n",
102
+ " <td>0.706766</td>\n",
103
+ " <td>0.618265</td>\n",
104
+ " <td>0.275324</td>\n",
105
+ " </tr>\n",
106
+ " <tr>\n",
107
+ " <th>3</th>\n",
108
+ " <td>Afghanistan</td>\n",
109
+ " <td>2011</td>\n",
110
+ " <td>3.831719</td>\n",
111
+ " <td>7.619532</td>\n",
112
+ " <td>0.521104</td>\n",
113
+ " <td>51.919998</td>\n",
114
+ " <td>0.495901</td>\n",
115
+ " <td>0.162427</td>\n",
116
+ " <td>0.731109</td>\n",
117
+ " <td>0.611387</td>\n",
118
+ " <td>0.267175</td>\n",
119
+ " </tr>\n",
120
+ " <tr>\n",
121
+ " <th>4</th>\n",
122
+ " <td>Afghanistan</td>\n",
123
+ " <td>2012</td>\n",
124
+ " <td>3.782938</td>\n",
125
+ " <td>7.705479</td>\n",
126
+ " <td>0.520637</td>\n",
127
+ " <td>52.240002</td>\n",
128
+ " <td>0.530935</td>\n",
129
+ " <td>0.236032</td>\n",
130
+ " <td>0.775620</td>\n",
131
+ " <td>0.710385</td>\n",
132
+ " <td>0.267919</td>\n",
133
+ " </tr>\n",
134
+ " </tbody>\n",
135
+ "</table>\n",
136
+ "</div>"
137
+ ],
138
+ "text/plain": [
139
+ " Country year Life Ladder Log GDP per capita Social support \\\n",
140
+ "0 Afghanistan 2008 3.723590 7.370100 0.450662 \n",
141
+ "1 Afghanistan 2009 4.401778 7.539972 0.552308 \n",
142
+ "2 Afghanistan 2010 4.758381 7.646709 0.539075 \n",
143
+ "3 Afghanistan 2011 3.831719 7.619532 0.521104 \n",
144
+ "4 Afghanistan 2012 3.782938 7.705479 0.520637 \n",
145
+ "\n",
146
+ " Healthy life expectancy at birth Freedom to make life choices Generosity \\\n",
147
+ "0 50.799999 0.718114 0.167640 \n",
148
+ "1 51.200001 0.678896 0.190099 \n",
149
+ "2 51.599998 0.600127 0.120590 \n",
150
+ "3 51.919998 0.495901 0.162427 \n",
151
+ "4 52.240002 0.530935 0.236032 \n",
152
+ "\n",
153
+ " Perceptions of corruption Positive affect Negative affect \n",
154
+ "0 0.881686 0.517637 0.258195 \n",
155
+ "1 0.850035 0.583926 0.237092 \n",
156
+ "2 0.706766 0.618265 0.275324 \n",
157
+ "3 0.731109 0.611387 0.267175 \n",
158
+ "4 0.775620 0.710385 0.267919 "
159
+ ]
160
+ },
161
+ "execution_count": 57,
162
+ "metadata": {},
163
+ "output_type": "execute_result"
164
+ }
165
+ ],
166
+ "source": [
167
+ "df.head()"
168
+ ]
169
+ },
170
+ {
171
+ "cell_type": "code",
172
+ "execution_count": 59,
173
+ "id": "a1d054e6-8ca7-4675-913e-b0b500afe105",
174
+ "metadata": {},
175
+ "outputs": [],
176
+ "source": [
177
+ "df_sorted = df.sort_values(by=['year'], ascending = False)"
178
+ ]
179
+ },
180
+ {
181
+ "cell_type": "code",
182
+ "execution_count": 60,
183
+ "id": "42d08d97-fa68-40dc-9cfd-b0aa8acbb838",
184
+ "metadata": {},
185
+ "outputs": [
186
+ {
187
+ "data": {
188
+ "text/html": [
189
+ "<div>\n",
190
+ "<style scoped>\n",
191
+ " .dataframe tbody tr th:only-of-type {\n",
192
+ " vertical-align: middle;\n",
193
+ " }\n",
194
+ "\n",
195
+ " .dataframe tbody tr th {\n",
196
+ " vertical-align: top;\n",
197
+ " }\n",
198
+ "\n",
199
+ " .dataframe thead th {\n",
200
+ " text-align: right;\n",
201
+ " }\n",
202
+ "</style>\n",
203
+ "<table border=\"1\" class=\"dataframe\">\n",
204
+ " <thead>\n",
205
+ " <tr style=\"text-align: right;\">\n",
206
+ " <th></th>\n",
207
+ " <th>Country</th>\n",
208
+ " <th>year</th>\n",
209
+ " <th>Life Ladder</th>\n",
210
+ " <th>Log GDP per capita</th>\n",
211
+ " <th>Social support</th>\n",
212
+ " <th>Healthy life expectancy at birth</th>\n",
213
+ " <th>Freedom to make life choices</th>\n",
214
+ " <th>Generosity</th>\n",
215
+ " <th>Perceptions of corruption</th>\n",
216
+ " <th>Positive affect</th>\n",
217
+ " <th>Negative affect</th>\n",
218
+ " </tr>\n",
219
+ " </thead>\n",
220
+ " <tbody>\n",
221
+ " <tr>\n",
222
+ " <th>1948</th>\n",
223
+ " <td>Zimbabwe</td>\n",
224
+ " <td>2020</td>\n",
225
+ " <td>3.159802</td>\n",
226
+ " <td>7.828757</td>\n",
227
+ " <td>0.717243</td>\n",
228
+ " <td>56.799999</td>\n",
229
+ " <td>0.643303</td>\n",
230
+ " <td>-0.008696</td>\n",
231
+ " <td>0.788523</td>\n",
232
+ " <td>0.702573</td>\n",
233
+ " <td>0.345736</td>\n",
234
+ " </tr>\n",
235
+ " <tr>\n",
236
+ " <th>174</th>\n",
237
+ " <td>Benin</td>\n",
238
+ " <td>2020</td>\n",
239
+ " <td>4.407746</td>\n",
240
+ " <td>8.102292</td>\n",
241
+ " <td>0.506636</td>\n",
242
+ " <td>55.099998</td>\n",
243
+ " <td>0.783115</td>\n",
244
+ " <td>-0.083489</td>\n",
245
+ " <td>0.531884</td>\n",
246
+ " <td>0.608585</td>\n",
247
+ " <td>0.304512</td>\n",
248
+ " </tr>\n",
249
+ " <tr>\n",
250
+ " <th>1835</th>\n",
251
+ " <td>United Kingdom</td>\n",
252
+ " <td>2020</td>\n",
253
+ " <td>6.798177</td>\n",
254
+ " <td>10.625811</td>\n",
255
+ " <td>0.929353</td>\n",
256
+ " <td>72.699997</td>\n",
257
+ " <td>0.884624</td>\n",
258
+ " <td>0.202508</td>\n",
259
+ " <td>0.490204</td>\n",
260
+ " <td>0.758164</td>\n",
261
+ " <td>0.224655</td>\n",
262
+ " </tr>\n",
263
+ " <tr>\n",
264
+ " <th>1394</th>\n",
265
+ " <td>Philippines</td>\n",
266
+ " <td>2020</td>\n",
267
+ " <td>5.079585</td>\n",
268
+ " <td>9.061443</td>\n",
269
+ " <td>0.781140</td>\n",
270
+ " <td>62.099998</td>\n",
271
+ " <td>0.932042</td>\n",
272
+ " <td>-0.115543</td>\n",
273
+ " <td>0.744284</td>\n",
274
+ " <td>0.803562</td>\n",
275
+ " <td>0.326889</td>\n",
276
+ " </tr>\n",
277
+ " <tr>\n",
278
+ " <th>785</th>\n",
279
+ " <td>Iraq</td>\n",
280
+ " <td>2020</td>\n",
281
+ " <td>4.785165</td>\n",
282
+ " <td>9.167186</td>\n",
283
+ " <td>0.707847</td>\n",
284
+ " <td>61.400002</td>\n",
285
+ " <td>0.700215</td>\n",
286
+ " <td>-0.020748</td>\n",
287
+ " <td>0.849109</td>\n",
288
+ " <td>0.644464</td>\n",
289
+ " <td>0.531539</td>\n",
290
+ " </tr>\n",
291
+ " </tbody>\n",
292
+ "</table>\n",
293
+ "</div>"
294
+ ],
295
+ "text/plain": [
296
+ " Country year Life Ladder Log GDP per capita Social support \\\n",
297
+ "1948 Zimbabwe 2020 3.159802 7.828757 0.717243 \n",
298
+ "174 Benin 2020 4.407746 8.102292 0.506636 \n",
299
+ "1835 United Kingdom 2020 6.798177 10.625811 0.929353 \n",
300
+ "1394 Philippines 2020 5.079585 9.061443 0.781140 \n",
301
+ "785 Iraq 2020 4.785165 9.167186 0.707847 \n",
302
+ "\n",
303
+ " Healthy life expectancy at birth Freedom to make life choices \\\n",
304
+ "1948 56.799999 0.643303 \n",
305
+ "174 55.099998 0.783115 \n",
306
+ "1835 72.699997 0.884624 \n",
307
+ "1394 62.099998 0.932042 \n",
308
+ "785 61.400002 0.700215 \n",
309
+ "\n",
310
+ " Generosity Perceptions of corruption Positive affect Negative affect \n",
311
+ "1948 -0.008696 0.788523 0.702573 0.345736 \n",
312
+ "174 -0.083489 0.531884 0.608585 0.304512 \n",
313
+ "1835 0.202508 0.490204 0.758164 0.224655 \n",
314
+ "1394 -0.115543 0.744284 0.803562 0.326889 \n",
315
+ "785 -0.020748 0.849109 0.644464 0.531539 "
316
+ ]
317
+ },
318
+ "execution_count": 60,
319
+ "metadata": {},
320
+ "output_type": "execute_result"
321
+ }
322
+ ],
323
+ "source": [
324
+ "df_sorted.head()"
325
+ ]
326
+ },
327
+ {
328
+ "cell_type": "code",
329
+ "execution_count": 61,
330
+ "id": "abb8954c-106f-42d1-bf2a-0200b8927306",
331
+ "metadata": {},
332
+ "outputs": [],
333
+ "source": [
334
+ "df_dedup = df_sorted.drop_duplicates(subset=['Country'])"
335
+ ]
336
+ },
337
+ {
338
+ "cell_type": "code",
339
+ "execution_count": 62,
340
+ "id": "969f5fcf-5dc6-4ce3-93f7-0f35473f3c73",
341
+ "metadata": {},
342
+ "outputs": [
343
+ {
344
+ "data": {
345
+ "text/html": [
346
+ "<div>\n",
347
+ "<style scoped>\n",
348
+ " .dataframe tbody tr th:only-of-type {\n",
349
+ " vertical-align: middle;\n",
350
+ " }\n",
351
+ "\n",
352
+ " .dataframe tbody tr th {\n",
353
+ " vertical-align: top;\n",
354
+ " }\n",
355
+ "\n",
356
+ " .dataframe thead th {\n",
357
+ " text-align: right;\n",
358
+ " }\n",
359
+ "</style>\n",
360
+ "<table border=\"1\" class=\"dataframe\">\n",
361
+ " <thead>\n",
362
+ " <tr style=\"text-align: right;\">\n",
363
+ " <th></th>\n",
364
+ " <th>Country</th>\n",
365
+ " <th>year</th>\n",
366
+ " <th>Life Ladder</th>\n",
367
+ " <th>Log GDP per capita</th>\n",
368
+ " <th>Social support</th>\n",
369
+ " <th>Healthy life expectancy at birth</th>\n",
370
+ " <th>Freedom to make life choices</th>\n",
371
+ " <th>Generosity</th>\n",
372
+ " <th>Perceptions of corruption</th>\n",
373
+ " <th>Positive affect</th>\n",
374
+ " <th>Negative affect</th>\n",
375
+ " </tr>\n",
376
+ " </thead>\n",
377
+ " <tbody>\n",
378
+ " <tr>\n",
379
+ " <th>1948</th>\n",
380
+ " <td>Zimbabwe</td>\n",
381
+ " <td>2020</td>\n",
382
+ " <td>3.159802</td>\n",
383
+ " <td>7.828757</td>\n",
384
+ " <td>0.717243</td>\n",
385
+ " <td>56.799999</td>\n",
386
+ " <td>0.643303</td>\n",
387
+ " <td>-0.008696</td>\n",
388
+ " <td>0.788523</td>\n",
389
+ " <td>0.702573</td>\n",
390
+ " <td>0.345736</td>\n",
391
+ " </tr>\n",
392
+ " <tr>\n",
393
+ " <th>174</th>\n",
394
+ " <td>Benin</td>\n",
395
+ " <td>2020</td>\n",
396
+ " <td>4.407746</td>\n",
397
+ " <td>8.102292</td>\n",
398
+ " <td>0.506636</td>\n",
399
+ " <td>55.099998</td>\n",
400
+ " <td>0.783115</td>\n",
401
+ " <td>-0.083489</td>\n",
402
+ " <td>0.531884</td>\n",
403
+ " <td>0.608585</td>\n",
404
+ " <td>0.304512</td>\n",
405
+ " </tr>\n",
406
+ " <tr>\n",
407
+ " <th>1835</th>\n",
408
+ " <td>United Kingdom</td>\n",
409
+ " <td>2020</td>\n",
410
+ " <td>6.798177</td>\n",
411
+ " <td>10.625811</td>\n",
412
+ " <td>0.929353</td>\n",
413
+ " <td>72.699997</td>\n",
414
+ " <td>0.884624</td>\n",
415
+ " <td>0.202508</td>\n",
416
+ " <td>0.490204</td>\n",
417
+ " <td>0.758164</td>\n",
418
+ " <td>0.224655</td>\n",
419
+ " </tr>\n",
420
+ " <tr>\n",
421
+ " <th>1394</th>\n",
422
+ " <td>Philippines</td>\n",
423
+ " <td>2020</td>\n",
424
+ " <td>5.079585</td>\n",
425
+ " <td>9.061443</td>\n",
426
+ " <td>0.781140</td>\n",
427
+ " <td>62.099998</td>\n",
428
+ " <td>0.932042</td>\n",
429
+ " <td>-0.115543</td>\n",
430
+ " <td>0.744284</td>\n",
431
+ " <td>0.803562</td>\n",
432
+ " <td>0.326889</td>\n",
433
+ " </tr>\n",
434
+ " <tr>\n",
435
+ " <th>785</th>\n",
436
+ " <td>Iraq</td>\n",
437
+ " <td>2020</td>\n",
438
+ " <td>4.785165</td>\n",
439
+ " <td>9.167186</td>\n",
440
+ " <td>0.707847</td>\n",
441
+ " <td>61.400002</td>\n",
442
+ " <td>0.700215</td>\n",
443
+ " <td>-0.020748</td>\n",
444
+ " <td>0.849109</td>\n",
445
+ " <td>0.644464</td>\n",
446
+ " <td>0.531539</td>\n",
447
+ " </tr>\n",
448
+ " </tbody>\n",
449
+ "</table>\n",
450
+ "</div>"
451
+ ],
452
+ "text/plain": [
453
+ " Country year Life Ladder Log GDP per capita Social support \\\n",
454
+ "1948 Zimbabwe 2020 3.159802 7.828757 0.717243 \n",
455
+ "174 Benin 2020 4.407746 8.102292 0.506636 \n",
456
+ "1835 United Kingdom 2020 6.798177 10.625811 0.929353 \n",
457
+ "1394 Philippines 2020 5.079585 9.061443 0.781140 \n",
458
+ "785 Iraq 2020 4.785165 9.167186 0.707847 \n",
459
+ "\n",
460
+ " Healthy life expectancy at birth Freedom to make life choices \\\n",
461
+ "1948 56.799999 0.643303 \n",
462
+ "174 55.099998 0.783115 \n",
463
+ "1835 72.699997 0.884624 \n",
464
+ "1394 62.099998 0.932042 \n",
465
+ "785 61.400002 0.700215 \n",
466
+ "\n",
467
+ " Generosity Perceptions of corruption Positive affect Negative affect \n",
468
+ "1948 -0.008696 0.788523 0.702573 0.345736 \n",
469
+ "174 -0.083489 0.531884 0.608585 0.304512 \n",
470
+ "1835 0.202508 0.490204 0.758164 0.224655 \n",
471
+ "1394 -0.115543 0.744284 0.803562 0.326889 \n",
472
+ "785 -0.020748 0.849109 0.644464 0.531539 "
473
+ ]
474
+ },
475
+ "execution_count": 62,
476
+ "metadata": {},
477
+ "output_type": "execute_result"
478
+ }
479
+ ],
480
+ "source": [
481
+ "df_dedup.head()"
482
+ ]
483
+ },
484
+ {
485
+ "cell_type": "code",
486
+ "execution_count": 63,
487
+ "id": "d080546c-4698-4edd-8b76-e3c94aee9862",
488
+ "metadata": {},
489
+ "outputs": [
490
+ {
491
+ "data": {
492
+ "text/plain": [
493
+ "1949"
494
+ ]
495
+ },
496
+ "execution_count": 63,
497
+ "metadata": {},
498
+ "output_type": "execute_result"
499
+ }
500
+ ],
501
+ "source": [
502
+ "len(df_sorted)"
503
+ ]
504
+ },
505
+ {
506
+ "cell_type": "code",
507
+ "execution_count": 64,
508
+ "id": "6a817f5c-e871-4d69-9368-00a90efc6007",
509
+ "metadata": {},
510
+ "outputs": [
511
+ {
512
+ "data": {
513
+ "text/plain": [
514
+ "166"
515
+ ]
516
+ },
517
+ "execution_count": 64,
518
+ "metadata": {},
519
+ "output_type": "execute_result"
520
+ }
521
+ ],
522
+ "source": [
523
+ "len(df_dedup)"
524
+ ]
525
+ },
526
+ {
527
+ "cell_type": "code",
528
+ "execution_count": 65,
529
+ "id": "d6640a42-064e-4b31-b89d-de4f7d4240a3",
530
+ "metadata": {},
531
+ "outputs": [
532
+ {
533
+ "data": {
534
+ "text/html": [
535
+ "<div>\n",
536
+ "<style scoped>\n",
537
+ " .dataframe tbody tr th:only-of-type {\n",
538
+ " vertical-align: middle;\n",
539
+ " }\n",
540
+ "\n",
541
+ " .dataframe tbody tr th {\n",
542
+ " vertical-align: top;\n",
543
+ " }\n",
544
+ "\n",
545
+ " .dataframe thead th {\n",
546
+ " text-align: right;\n",
547
+ " }\n",
548
+ "</style>\n",
549
+ "<table border=\"1\" class=\"dataframe\">\n",
550
+ " <thead>\n",
551
+ " <tr style=\"text-align: right;\">\n",
552
+ " <th></th>\n",
553
+ " <th>Country</th>\n",
554
+ " <th>Continent</th>\n",
555
+ " </tr>\n",
556
+ " </thead>\n",
557
+ " <tbody>\n",
558
+ " <tr>\n",
559
+ " <th>0</th>\n",
560
+ " <td>Algeria</td>\n",
561
+ " <td>Africa</td>\n",
562
+ " </tr>\n",
563
+ " <tr>\n",
564
+ " <th>1</th>\n",
565
+ " <td>Angola</td>\n",
566
+ " <td>Africa</td>\n",
567
+ " </tr>\n",
568
+ " <tr>\n",
569
+ " <th>2</th>\n",
570
+ " <td>Benin</td>\n",
571
+ " <td>Africa</td>\n",
572
+ " </tr>\n",
573
+ " <tr>\n",
574
+ " <th>3</th>\n",
575
+ " <td>Botswana</td>\n",
576
+ " <td>Africa</td>\n",
577
+ " </tr>\n",
578
+ " <tr>\n",
579
+ " <th>4</th>\n",
580
+ " <td>Burkina</td>\n",
581
+ " <td>Africa</td>\n",
582
+ " </tr>\n",
583
+ " </tbody>\n",
584
+ "</table>\n",
585
+ "</div>"
586
+ ],
587
+ "text/plain": [
588
+ " Country Continent\n",
589
+ "0 Algeria Africa\n",
590
+ "1 Angola Africa\n",
591
+ "2 Benin Africa\n",
592
+ "3 Botswana Africa\n",
593
+ "4 Burkina Africa"
594
+ ]
595
+ },
596
+ "execution_count": 65,
597
+ "metadata": {},
598
+ "output_type": "execute_result"
599
+ }
600
+ ],
601
+ "source": [
602
+ "df_csv = pd.read_csv(\"Assets/Countries/countries.csv\")\n",
603
+ "df_csv.head()"
604
+ ]
605
+ },
606
+ {
607
+ "cell_type": "code",
608
+ "execution_count": 18,
609
+ "id": "a6e6f52e-cff7-4d78-b630-e71e07fa8842",
610
+ "metadata": {},
611
+ "outputs": [
612
+ {
613
+ "data": {
614
+ "text/plain": [
615
+ "194"
616
+ ]
617
+ },
618
+ "execution_count": 18,
619
+ "metadata": {},
620
+ "output_type": "execute_result"
621
+ }
622
+ ],
623
+ "source": [
624
+ "len(df_csv)"
625
+ ]
626
+ },
627
+ {
628
+ "cell_type": "code",
629
+ "execution_count": 66,
630
+ "id": "edaae740-75bf-42a2-afa6-ebbbbf50d792",
631
+ "metadata": {},
632
+ "outputs": [],
633
+ "source": [
634
+ "c1 = df_dedup[\"Country\"]\n",
635
+ "c2 = list(df_csv[\"Country\"])\n",
636
+ "c3 = [(country, country in c2) for country in c1]"
637
+ ]
638
+ },
639
+ {
640
+ "cell_type": "code",
641
+ "execution_count": 67,
642
+ "id": "5e86b02e-e5a3-4eaf-b045-74f0d0cfea08",
643
+ "metadata": {},
644
+ "outputs": [
645
+ {
646
+ "data": {
647
+ "text/plain": [
648
+ "True"
649
+ ]
650
+ },
651
+ "execution_count": 67,
652
+ "metadata": {},
653
+ "output_type": "execute_result"
654
+ }
655
+ ],
656
+ "source": [
657
+ "\"Zimbabwe\" in c2"
658
+ ]
659
+ },
660
+ {
661
+ "cell_type": "code",
662
+ "execution_count": 68,
663
+ "id": "921765a7-6f40-4d6a-9403-f5f8d8f26a65",
664
+ "metadata": {},
665
+ "outputs": [
666
+ {
667
+ "data": {
668
+ "text/plain": [
669
+ "[('Zimbabwe', True),\n",
670
+ " ('Benin', True),\n",
671
+ " ('United Kingdom', True),\n",
672
+ " ('Philippines', True),\n",
673
+ " ('Iraq', True),\n",
674
+ " ('Belgium', True),\n",
675
+ " ('Iran', True),\n",
676
+ " ('Poland', True),\n",
677
+ " ('Portugal', True),\n",
678
+ " ('India', True),\n",
679
+ " ('Israel', True),\n",
680
+ " ('Iceland', True),\n",
681
+ " ('United Arab Emirates', True),\n",
682
+ " ('Hungary', True),\n",
683
+ " ('Hong Kong S.A.R. of China', False),\n",
684
+ " ('Bolivia', True),\n",
685
+ " ('Russia', False),\n",
686
+ " ('Saudi Arabia', True),\n",
687
+ " ('Ireland', True),\n",
688
+ " ('Italy', True),\n",
689
+ " ('Ukraine', True),\n",
690
+ " ('Kenya', True),\n",
691
+ " ('Latvia', True),\n",
692
+ " ('Laos', True),\n",
693
+ " ('Nigeria', True),\n",
694
+ " ('Austria', True),\n",
695
+ " ('Kyrgyzstan', True),\n",
696
+ " ('North Macedonia', False),\n",
697
+ " ('Kosovo', False),\n",
698
+ " ('Norway', True),\n",
699
+ " ('United States', False),\n",
700
+ " ('Kazakhstan', True),\n",
701
+ " ('Bahrain', True),\n",
702
+ " ('Uruguay', True),\n",
703
+ " ('Jordan', True),\n",
704
+ " ('Japan', True),\n",
705
+ " ('Bangladesh', True),\n",
706
+ " ('Ivory Coast', True),\n",
707
+ " ('Bosnia and Herzegovina', True),\n",
708
+ " ('Greece', True),\n",
709
+ " ('Australia', True),\n",
710
+ " ('Croatia', True),\n",
711
+ " ('Tunisia', True),\n",
712
+ " ('Spain', True),\n",
713
+ " ('Denmark', True),\n",
714
+ " ('Cameroon', True),\n",
715
+ " ('Czech Republic', False),\n",
716
+ " ('Cyprus', True),\n",
717
+ " ('Sweden', True),\n",
718
+ " ('Canada', True),\n",
719
+ " ('South Korea', False),\n",
720
+ " ('Switzerland', True),\n",
721
+ " ('Thailand', True),\n",
722
+ " ('Taiwan Province of China', False),\n",
723
+ " ('Colombia', True),\n",
724
+ " ('Tajikistan', True),\n",
725
+ " ('Tanzania', True),\n",
726
+ " ('China', True),\n",
727
+ " ('Dominican Republic', True),\n",
728
+ " ('Cambodia', True),\n",
729
+ " ('Ghana', True),\n",
730
+ " ('Slovakia', True),\n",
731
+ " ('Serbia', True),\n",
732
+ " ('Uganda', True),\n",
733
+ " ('Germany', True),\n",
734
+ " ('Georgia', True),\n",
735
+ " ('Brazil', True),\n",
736
+ " ('France', True),\n",
737
+ " ('Bulgaria', True),\n",
738
+ " ('Finland', True),\n",
739
+ " ('Ecuador', True),\n",
740
+ " ('Ethiopia', True),\n",
741
+ " ('Slovenia', True),\n",
742
+ " ('Estonia', True),\n",
743
+ " ('El Salvador', True),\n",
744
+ " ('Turkey', True),\n",
745
+ " ('South Africa', True),\n",
746
+ " ('Egypt', True),\n",
747
+ " ('Venezuela', True),\n",
748
+ " ('Chile', True),\n",
749
+ " ('Lithuania', True),\n",
750
+ " ('Moldova', True),\n",
751
+ " ('Netherlands', True),\n",
752
+ " ('Mongolia', True),\n",
753
+ " ('Mauritius', True),\n",
754
+ " ('Mexico', True),\n",
755
+ " ('New Zealand', True),\n",
756
+ " ('Namibia', True),\n",
757
+ " ('Myanmar', False),\n",
758
+ " ('Malta', True),\n",
759
+ " ('Zambia', True),\n",
760
+ " ('Argentina', True),\n",
761
+ " ('Morocco', True),\n",
762
+ " ('Albania', True),\n",
763
+ " ('Montenegro', True),\n",
764
+ " ('Guinea', True),\n",
765
+ " ('Yemen', True),\n",
766
+ " ('Guatemala', True),\n",
767
+ " ('Malaysia', True),\n",
768
+ " ('Rwanda', True),\n",
769
+ " ('Sri Lanka', True),\n",
770
+ " ('Malawi', True),\n",
771
+ " ('Nepal', True),\n",
772
+ " ('Swaziland', True),\n",
773
+ " ('Romania', True),\n",
774
+ " ('Senegal', True),\n",
775
+ " ('Honduras', True),\n",
776
+ " ('Mali', True),\n",
777
+ " ('Mauritania', True),\n",
778
+ " ('Turkmenistan', True),\n",
779
+ " ('Burkina Faso', False),\n",
780
+ " ('Algeria', True),\n",
781
+ " ('Botswana', True),\n",
782
+ " ('Sierra Leone', True),\n",
783
+ " ('Mozambique', True),\n",
784
+ " ('Singapore', True),\n",
785
+ " ('Gambia', True),\n",
786
+ " ('Gabon', True),\n",
787
+ " ('Indonesia', True),\n",
788
+ " ('Azerbaijan', True),\n",
789
+ " ('Chad', True),\n",
790
+ " ('Liberia', True),\n",
791
+ " ('Libya', True),\n",
792
+ " ('Pakistan', True),\n",
793
+ " ('Armenia', True),\n",
794
+ " ('Comoros', True),\n",
795
+ " ('Afghanistan', True),\n",
796
+ " ('Palestinian Territories', False),\n",
797
+ " ('Nicaragua', True),\n",
798
+ " ('Niger', True),\n",
799
+ " ('Lebanon', True),\n",
800
+ " ('Lesotho', True),\n",
801
+ " ('Uzbekistan', True),\n",
802
+ " ('North Cyprus', False),\n",
803
+ " ('Kuwait', True),\n",
804
+ " ('Congo (Brazzaville)', False),\n",
805
+ " ('Peru', True),\n",
806
+ " ('Vietnam', True),\n",
807
+ " ('Togo', True),\n",
808
+ " ('Belarus', True),\n",
809
+ " ('Madagascar', True),\n",
810
+ " ('Costa Rica', True),\n",
811
+ " ('Luxembourg', True),\n",
812
+ " ('Panama', True),\n",
813
+ " ('Paraguay', True),\n",
814
+ " ('Jamaica', True),\n",
815
+ " ('Maldives', True),\n",
816
+ " ('Haiti', True),\n",
817
+ " ('Burundi', True),\n",
818
+ " ('Congo (Kinshasa)', False),\n",
819
+ " ('Central African Republic', True),\n",
820
+ " ('Trinidad and Tobago', True),\n",
821
+ " ('South Sudan', True),\n",
822
+ " ('Somalia', True),\n",
823
+ " ('Syria', True),\n",
824
+ " ('Qatar', True),\n",
825
+ " ('Bhutan', True),\n",
826
+ " ('Sudan', True),\n",
827
+ " ('Angola', True),\n",
828
+ " ('Belize', True),\n",
829
+ " ('Suriname', True),\n",
830
+ " ('Somaliland region', False),\n",
831
+ " ('Oman', True),\n",
832
+ " ('Djibouti', True),\n",
833
+ " ('Guyana', True),\n",
834
+ " ('Cuba', True)]"
835
+ ]
836
+ },
837
+ "execution_count": 68,
838
+ "metadata": {},
839
+ "output_type": "execute_result"
840
+ }
841
+ ],
842
+ "source": [
843
+ "c3"
844
+ ]
845
+ },
846
+ {
847
+ "cell_type": "code",
848
+ "execution_count": 37,
849
+ "id": "ff74b057-7281-4ab2-82c5-367e949fbbed",
850
+ "metadata": {},
851
+ "outputs": [
852
+ {
853
+ "data": {
854
+ "text/plain": [
855
+ "['Hong Kong S.A.R. of China',\n",
856
+ " 'Russia',\n",
857
+ " 'North Macedonia',\n",
858
+ " 'Kosovo',\n",
859
+ " 'United States',\n",
860
+ " 'Czech Republic',\n",
861
+ " 'South Korea',\n",
862
+ " 'Taiwan Province of China',\n",
863
+ " 'Myanmar',\n",
864
+ " 'Burkina Faso',\n",
865
+ " 'Palestinian Territories',\n",
866
+ " 'North Cyprus',\n",
867
+ " 'Congo (Brazzaville)',\n",
868
+ " 'Congo (Kinshasa)',\n",
869
+ " 'Somaliland region']"
870
+ ]
871
+ },
872
+ "execution_count": 37,
873
+ "metadata": {},
874
+ "output_type": "execute_result"
875
+ }
876
+ ],
877
+ "source": [
878
+ "num = 0\n",
879
+ "missing = []\n",
880
+ "for pair in c3:\n",
881
+ " if pair[1]:\n",
882
+ " num +=1\n",
883
+ " else:\n",
884
+ " missing.append(pair[0]) \n",
885
+ "num\n",
886
+ "missing"
887
+ ]
888
+ },
889
+ {
890
+ "cell_type": "code",
891
+ "execution_count": 44,
892
+ "id": "50f20260-3ed6-4f4e-a558-e3c6374ecb26",
893
+ "metadata": {},
894
+ "outputs": [
895
+ {
896
+ "data": {
897
+ "text/plain": [
898
+ "'Africa'"
899
+ ]
900
+ },
901
+ "execution_count": 44,
902
+ "metadata": {},
903
+ "output_type": "execute_result"
904
+ }
905
+ ],
906
+ "source": [
907
+ "df_csv.loc[df_csv['Country'] == \"Madagascar\", 'Continent'].iloc[0]"
908
+ ]
909
+ },
910
+ {
911
+ "cell_type": "code",
912
+ "execution_count": 50,
913
+ "id": "9dfa66ef-1c2b-4893-8993-107c2e02a2c8",
914
+ "metadata": {},
915
+ "outputs": [
916
+ {
917
+ "data": {
918
+ "text/html": [
919
+ "<div>\n",
920
+ "<style scoped>\n",
921
+ " .dataframe tbody tr th:only-of-type {\n",
922
+ " vertical-align: middle;\n",
923
+ " }\n",
924
+ "\n",
925
+ " .dataframe tbody tr th {\n",
926
+ " vertical-align: top;\n",
927
+ " }\n",
928
+ "\n",
929
+ " .dataframe thead th {\n",
930
+ " text-align: right;\n",
931
+ " }\n",
932
+ "</style>\n",
933
+ "<table border=\"1\" class=\"dataframe\">\n",
934
+ " <thead>\n",
935
+ " <tr style=\"text-align: right;\">\n",
936
+ " <th></th>\n",
937
+ " <th>Country name</th>\n",
938
+ " <th>year</th>\n",
939
+ " <th>Life Ladder</th>\n",
940
+ " <th>Log GDP per capita</th>\n",
941
+ " <th>Social support</th>\n",
942
+ " <th>Healthy life expectancy at birth</th>\n",
943
+ " <th>Freedom to make life choices</th>\n",
944
+ " <th>Generosity</th>\n",
945
+ " <th>Perceptions of corruption</th>\n",
946
+ " <th>Positive affect</th>\n",
947
+ " <th>Negative affect</th>\n",
948
+ " <th>Continent</th>\n",
949
+ " </tr>\n",
950
+ " </thead>\n",
951
+ " <tbody>\n",
952
+ " <tr>\n",
953
+ " <th>1948</th>\n",
954
+ " <td>Zimbabwe</td>\n",
955
+ " <td>2020</td>\n",
956
+ " <td>3.159802</td>\n",
957
+ " <td>7.828757</td>\n",
958
+ " <td>0.717243</td>\n",
959
+ " <td>56.799999</td>\n",
960
+ " <td>0.643303</td>\n",
961
+ " <td>-0.008696</td>\n",
962
+ " <td>0.788523</td>\n",
963
+ " <td>0.702573</td>\n",
964
+ " <td>0.345736</td>\n",
965
+ " <td>&lt;pandas.core.indexing._iLocIndexer object at 0...</td>\n",
966
+ " </tr>\n",
967
+ " <tr>\n",
968
+ " <th>174</th>\n",
969
+ " <td>Benin</td>\n",
970
+ " <td>2020</td>\n",
971
+ " <td>4.407746</td>\n",
972
+ " <td>8.102292</td>\n",
973
+ " <td>0.506636</td>\n",
974
+ " <td>55.099998</td>\n",
975
+ " <td>0.783115</td>\n",
976
+ " <td>-0.083489</td>\n",
977
+ " <td>0.531884</td>\n",
978
+ " <td>0.608585</td>\n",
979
+ " <td>0.304512</td>\n",
980
+ " <td>&lt;pandas.core.indexing._iLocIndexer object at 0...</td>\n",
981
+ " </tr>\n",
982
+ " <tr>\n",
983
+ " <th>1835</th>\n",
984
+ " <td>United Kingdom</td>\n",
985
+ " <td>2020</td>\n",
986
+ " <td>6.798177</td>\n",
987
+ " <td>10.625811</td>\n",
988
+ " <td>0.929353</td>\n",
989
+ " <td>72.699997</td>\n",
990
+ " <td>0.884624</td>\n",
991
+ " <td>0.202508</td>\n",
992
+ " <td>0.490204</td>\n",
993
+ " <td>0.758164</td>\n",
994
+ " <td>0.224655</td>\n",
995
+ " <td>&lt;pandas.core.indexing._iLocIndexer object at 0...</td>\n",
996
+ " </tr>\n",
997
+ " <tr>\n",
998
+ " <th>1394</th>\n",
999
+ " <td>Philippines</td>\n",
1000
+ " <td>2020</td>\n",
1001
+ " <td>5.079585</td>\n",
1002
+ " <td>9.061443</td>\n",
1003
+ " <td>0.781140</td>\n",
1004
+ " <td>62.099998</td>\n",
1005
+ " <td>0.932042</td>\n",
1006
+ " <td>-0.115543</td>\n",
1007
+ " <td>0.744284</td>\n",
1008
+ " <td>0.803562</td>\n",
1009
+ " <td>0.326889</td>\n",
1010
+ " <td>&lt;pandas.core.indexing._iLocIndexer object at 0...</td>\n",
1011
+ " </tr>\n",
1012
+ " <tr>\n",
1013
+ " <th>785</th>\n",
1014
+ " <td>Iraq</td>\n",
1015
+ " <td>2020</td>\n",
1016
+ " <td>4.785165</td>\n",
1017
+ " <td>9.167186</td>\n",
1018
+ " <td>0.707847</td>\n",
1019
+ " <td>61.400002</td>\n",
1020
+ " <td>0.700215</td>\n",
1021
+ " <td>-0.020748</td>\n",
1022
+ " <td>0.849109</td>\n",
1023
+ " <td>0.644464</td>\n",
1024
+ " <td>0.531539</td>\n",
1025
+ " <td>&lt;pandas.core.indexing._iLocIndexer object at 0...</td>\n",
1026
+ " </tr>\n",
1027
+ " </tbody>\n",
1028
+ "</table>\n",
1029
+ "</div>"
1030
+ ],
1031
+ "text/plain": [
1032
+ " Country name year Life Ladder Log GDP per capita Social support \\\n",
1033
+ "1948 Zimbabwe 2020 3.159802 7.828757 0.717243 \n",
1034
+ "174 Benin 2020 4.407746 8.102292 0.506636 \n",
1035
+ "1835 United Kingdom 2020 6.798177 10.625811 0.929353 \n",
1036
+ "1394 Philippines 2020 5.079585 9.061443 0.781140 \n",
1037
+ "785 Iraq 2020 4.785165 9.167186 0.707847 \n",
1038
+ "\n",
1039
+ " Healthy life expectancy at birth Freedom to make life choices \\\n",
1040
+ "1948 56.799999 0.643303 \n",
1041
+ "174 55.099998 0.783115 \n",
1042
+ "1835 72.699997 0.884624 \n",
1043
+ "1394 62.099998 0.932042 \n",
1044
+ "785 61.400002 0.700215 \n",
1045
+ "\n",
1046
+ " Generosity Perceptions of corruption Positive affect Negative affect \\\n",
1047
+ "1948 -0.008696 0.788523 0.702573 0.345736 \n",
1048
+ "174 -0.083489 0.531884 0.608585 0.304512 \n",
1049
+ "1835 0.202508 0.490204 0.758164 0.224655 \n",
1050
+ "1394 -0.115543 0.744284 0.803562 0.326889 \n",
1051
+ "785 -0.020748 0.849109 0.644464 0.531539 \n",
1052
+ "\n",
1053
+ " Continent \n",
1054
+ "1948 <pandas.core.indexing._iLocIndexer object at 0... \n",
1055
+ "174 <pandas.core.indexing._iLocIndexer object at 0... \n",
1056
+ "1835 <pandas.core.indexing._iLocIndexer object at 0... \n",
1057
+ "1394 <pandas.core.indexing._iLocIndexer object at 0... \n",
1058
+ "785 <pandas.core.indexing._iLocIndexer object at 0... "
1059
+ ]
1060
+ },
1061
+ "execution_count": 50,
1062
+ "metadata": {},
1063
+ "output_type": "execute_result"
1064
+ }
1065
+ ],
1066
+ "source": [
1067
+ "df_dedup.head()"
1068
+ ]
1069
+ },
1070
+ {
1071
+ "cell_type": "code",
1072
+ "execution_count": 74,
1073
+ "id": "b1fcd392-abfb-42a8-8485-f3fbd6a155d1",
1074
+ "metadata": {},
1075
+ "outputs": [],
1076
+ "source": [
1077
+ "df_cont = df_dedup.set_index('Country').join(df_csv.set_index('Country'), on='Country', how='left')"
1078
+ ]
1079
+ },
1080
+ {
1081
+ "cell_type": "code",
1082
+ "execution_count": 77,
1083
+ "id": "55ec121c-534e-4e25-88e9-5ab8267fd66b",
1084
+ "metadata": {},
1085
+ "outputs": [],
1086
+ "source": [
1087
+ "df_cont = df_cont.reset_index()"
1088
+ ]
1089
+ },
1090
+ {
1091
+ "cell_type": "code",
1092
+ "execution_count": 78,
1093
+ "id": "8ddaf798-772d-489d-b2fc-32d4cd76ae50",
1094
+ "metadata": {},
1095
+ "outputs": [
1096
+ {
1097
+ "data": {
1098
+ "text/plain": [
1099
+ "166"
1100
+ ]
1101
+ },
1102
+ "execution_count": 78,
1103
+ "metadata": {},
1104
+ "output_type": "execute_result"
1105
+ }
1106
+ ],
1107
+ "source": [
1108
+ "len(df_cont)"
1109
+ ]
1110
+ },
1111
+ {
1112
+ "cell_type": "code",
1113
+ "execution_count": 79,
1114
+ "id": "7420265a-e079-443c-9be0-01becf73a836",
1115
+ "metadata": {},
1116
+ "outputs": [
1117
+ {
1118
+ "data": {
1119
+ "text/html": [
1120
+ "<div>\n",
1121
+ "<style scoped>\n",
1122
+ " .dataframe tbody tr th:only-of-type {\n",
1123
+ " vertical-align: middle;\n",
1124
+ " }\n",
1125
+ "\n",
1126
+ " .dataframe tbody tr th {\n",
1127
+ " vertical-align: top;\n",
1128
+ " }\n",
1129
+ "\n",
1130
+ " .dataframe thead th {\n",
1131
+ " text-align: right;\n",
1132
+ " }\n",
1133
+ "</style>\n",
1134
+ "<table border=\"1\" class=\"dataframe\">\n",
1135
+ " <thead>\n",
1136
+ " <tr style=\"text-align: right;\">\n",
1137
+ " <th></th>\n",
1138
+ " <th>Country</th>\n",
1139
+ " <th>year</th>\n",
1140
+ " <th>Life Ladder</th>\n",
1141
+ " <th>Log GDP per capita</th>\n",
1142
+ " <th>Social support</th>\n",
1143
+ " <th>Healthy life expectancy at birth</th>\n",
1144
+ " <th>Freedom to make life choices</th>\n",
1145
+ " <th>Generosity</th>\n",
1146
+ " <th>Perceptions of corruption</th>\n",
1147
+ " <th>Positive affect</th>\n",
1148
+ " <th>Negative affect</th>\n",
1149
+ " <th>Continent</th>\n",
1150
+ " </tr>\n",
1151
+ " </thead>\n",
1152
+ " <tbody>\n",
1153
+ " <tr>\n",
1154
+ " <th>0</th>\n",
1155
+ " <td>Zimbabwe</td>\n",
1156
+ " <td>2020</td>\n",
1157
+ " <td>3.159802</td>\n",
1158
+ " <td>7.828757</td>\n",
1159
+ " <td>0.717243</td>\n",
1160
+ " <td>56.799999</td>\n",
1161
+ " <td>0.643303</td>\n",
1162
+ " <td>-0.008696</td>\n",
1163
+ " <td>0.788523</td>\n",
1164
+ " <td>0.702573</td>\n",
1165
+ " <td>0.345736</td>\n",
1166
+ " <td>Africa</td>\n",
1167
+ " </tr>\n",
1168
+ " <tr>\n",
1169
+ " <th>1</th>\n",
1170
+ " <td>Benin</td>\n",
1171
+ " <td>2020</td>\n",
1172
+ " <td>4.407746</td>\n",
1173
+ " <td>8.102292</td>\n",
1174
+ " <td>0.506636</td>\n",
1175
+ " <td>55.099998</td>\n",
1176
+ " <td>0.783115</td>\n",
1177
+ " <td>-0.083489</td>\n",
1178
+ " <td>0.531884</td>\n",
1179
+ " <td>0.608585</td>\n",
1180
+ " <td>0.304512</td>\n",
1181
+ " <td>Africa</td>\n",
1182
+ " </tr>\n",
1183
+ " <tr>\n",
1184
+ " <th>2</th>\n",
1185
+ " <td>United Kingdom</td>\n",
1186
+ " <td>2020</td>\n",
1187
+ " <td>6.798177</td>\n",
1188
+ " <td>10.625811</td>\n",
1189
+ " <td>0.929353</td>\n",
1190
+ " <td>72.699997</td>\n",
1191
+ " <td>0.884624</td>\n",
1192
+ " <td>0.202508</td>\n",
1193
+ " <td>0.490204</td>\n",
1194
+ " <td>0.758164</td>\n",
1195
+ " <td>0.224655</td>\n",
1196
+ " <td>Europe</td>\n",
1197
+ " </tr>\n",
1198
+ " <tr>\n",
1199
+ " <th>3</th>\n",
1200
+ " <td>Philippines</td>\n",
1201
+ " <td>2020</td>\n",
1202
+ " <td>5.079585</td>\n",
1203
+ " <td>9.061443</td>\n",
1204
+ " <td>0.781140</td>\n",
1205
+ " <td>62.099998</td>\n",
1206
+ " <td>0.932042</td>\n",
1207
+ " <td>-0.115543</td>\n",
1208
+ " <td>0.744284</td>\n",
1209
+ " <td>0.803562</td>\n",
1210
+ " <td>0.326889</td>\n",
1211
+ " <td>Asia</td>\n",
1212
+ " </tr>\n",
1213
+ " <tr>\n",
1214
+ " <th>4</th>\n",
1215
+ " <td>Iraq</td>\n",
1216
+ " <td>2020</td>\n",
1217
+ " <td>4.785165</td>\n",
1218
+ " <td>9.167186</td>\n",
1219
+ " <td>0.707847</td>\n",
1220
+ " <td>61.400002</td>\n",
1221
+ " <td>0.700215</td>\n",
1222
+ " <td>-0.020748</td>\n",
1223
+ " <td>0.849109</td>\n",
1224
+ " <td>0.644464</td>\n",
1225
+ " <td>0.531539</td>\n",
1226
+ " <td>Asia</td>\n",
1227
+ " </tr>\n",
1228
+ " </tbody>\n",
1229
+ "</table>\n",
1230
+ "</div>"
1231
+ ],
1232
+ "text/plain": [
1233
+ " Country year Life Ladder Log GDP per capita Social support \\\n",
1234
+ "0 Zimbabwe 2020 3.159802 7.828757 0.717243 \n",
1235
+ "1 Benin 2020 4.407746 8.102292 0.506636 \n",
1236
+ "2 United Kingdom 2020 6.798177 10.625811 0.929353 \n",
1237
+ "3 Philippines 2020 5.079585 9.061443 0.781140 \n",
1238
+ "4 Iraq 2020 4.785165 9.167186 0.707847 \n",
1239
+ "\n",
1240
+ " Healthy life expectancy at birth Freedom to make life choices Generosity \\\n",
1241
+ "0 56.799999 0.643303 -0.008696 \n",
1242
+ "1 55.099998 0.783115 -0.083489 \n",
1243
+ "2 72.699997 0.884624 0.202508 \n",
1244
+ "3 62.099998 0.932042 -0.115543 \n",
1245
+ "4 61.400002 0.700215 -0.020748 \n",
1246
+ "\n",
1247
+ " Perceptions of corruption Positive affect Negative affect Continent \n",
1248
+ "0 0.788523 0.702573 0.345736 Africa \n",
1249
+ "1 0.531884 0.608585 0.304512 Africa \n",
1250
+ "2 0.490204 0.758164 0.224655 Europe \n",
1251
+ "3 0.744284 0.803562 0.326889 Asia \n",
1252
+ "4 0.849109 0.644464 0.531539 Asia "
1253
+ ]
1254
+ },
1255
+ "execution_count": 79,
1256
+ "metadata": {},
1257
+ "output_type": "execute_result"
1258
+ }
1259
+ ],
1260
+ "source": [
1261
+ "df_cont.head()"
1262
+ ]
1263
+ },
1264
+ {
1265
+ "cell_type": "code",
1266
+ "execution_count": 81,
1267
+ "id": "fb26fc2f-f591-4e66-9357-0928c2c46e89",
1268
+ "metadata": {},
1269
+ "outputs": [],
1270
+ "source": [
1271
+ "# I updated the name of the output so that I don't accidentally overwrite the manual work I did at the end to add in the last few outliers.\n",
1272
+ "#df_cont.to_csv(\"Assets/Countries/base-combined-countries.csv\")"
1273
+ ]
1274
+ },
1275
+ {
1276
+ "cell_type": "code",
1277
+ "execution_count": 83,
1278
+ "id": "445a79b2-0023-4812-b606-1ff9cb7720e7",
1279
+ "metadata": {},
1280
+ "outputs": [],
1281
+ "source": [
1282
+ "df3 = df_csv.set_index('Country').join(df_dedup.set_index('Country'), on='Country', how='left')"
1283
+ ]
1284
+ },
1285
+ {
1286
+ "cell_type": "code",
1287
+ "execution_count": 87,
1288
+ "id": "59c3d6bb-11ea-4b4f-9a9e-d9b58561e8f2",
1289
+ "metadata": {},
1290
+ "outputs": [],
1291
+ "source": [
1292
+ "df3 = df3[df3.year.isnull()]"
1293
+ ]
1294
+ },
1295
+ {
1296
+ "cell_type": "code",
1297
+ "execution_count": 88,
1298
+ "id": "3b76dce1-a02f-4b09-bc44-b0e28271bc56",
1299
+ "metadata": {},
1300
+ "outputs": [
1301
+ {
1302
+ "data": {
1303
+ "text/html": [
1304
+ "<div>\n",
1305
+ "<style scoped>\n",
1306
+ " .dataframe tbody tr th:only-of-type {\n",
1307
+ " vertical-align: middle;\n",
1308
+ " }\n",
1309
+ "\n",
1310
+ " .dataframe tbody tr th {\n",
1311
+ " vertical-align: top;\n",
1312
+ " }\n",
1313
+ "\n",
1314
+ " .dataframe thead th {\n",
1315
+ " text-align: right;\n",
1316
+ " }\n",
1317
+ "</style>\n",
1318
+ "<table border=\"1\" class=\"dataframe\">\n",
1319
+ " <thead>\n",
1320
+ " <tr style=\"text-align: right;\">\n",
1321
+ " <th></th>\n",
1322
+ " <th>Continent</th>\n",
1323
+ " <th>year</th>\n",
1324
+ " <th>Life Ladder</th>\n",
1325
+ " <th>Log GDP per capita</th>\n",
1326
+ " <th>Social support</th>\n",
1327
+ " <th>Healthy life expectancy at birth</th>\n",
1328
+ " <th>Freedom to make life choices</th>\n",
1329
+ " <th>Generosity</th>\n",
1330
+ " <th>Perceptions of corruption</th>\n",
1331
+ " <th>Positive affect</th>\n",
1332
+ " <th>Negative affect</th>\n",
1333
+ " </tr>\n",
1334
+ " <tr>\n",
1335
+ " <th>Country</th>\n",
1336
+ " <th></th>\n",
1337
+ " <th></th>\n",
1338
+ " <th></th>\n",
1339
+ " <th></th>\n",
1340
+ " <th></th>\n",
1341
+ " <th></th>\n",
1342
+ " <th></th>\n",
1343
+ " <th></th>\n",
1344
+ " <th></th>\n",
1345
+ " <th></th>\n",
1346
+ " <th></th>\n",
1347
+ " </tr>\n",
1348
+ " </thead>\n",
1349
+ " <tbody>\n",
1350
+ " <tr>\n",
1351
+ " <th>Burkina</th>\n",
1352
+ " <td>Africa</td>\n",
1353
+ " <td>NaN</td>\n",
1354
+ " <td>NaN</td>\n",
1355
+ " <td>NaN</td>\n",
1356
+ " <td>NaN</td>\n",
1357
+ " <td>NaN</td>\n",
1358
+ " <td>NaN</td>\n",
1359
+ " <td>NaN</td>\n",
1360
+ " <td>NaN</td>\n",
1361
+ " <td>NaN</td>\n",
1362
+ " <td>NaN</td>\n",
1363
+ " </tr>\n",
1364
+ " <tr>\n",
1365
+ " <th>Cape Verde</th>\n",
1366
+ " <td>Africa</td>\n",
1367
+ " <td>NaN</td>\n",
1368
+ " <td>NaN</td>\n",
1369
+ " <td>NaN</td>\n",
1370
+ " <td>NaN</td>\n",
1371
+ " <td>NaN</td>\n",
1372
+ " <td>NaN</td>\n",
1373
+ " <td>NaN</td>\n",
1374
+ " <td>NaN</td>\n",
1375
+ " <td>NaN</td>\n",
1376
+ " <td>NaN</td>\n",
1377
+ " </tr>\n",
1378
+ " <tr>\n",
1379
+ " <th>Congo</th>\n",
1380
+ " <td>Africa</td>\n",
1381
+ " <td>NaN</td>\n",
1382
+ " <td>NaN</td>\n",
1383
+ " <td>NaN</td>\n",
1384
+ " <td>NaN</td>\n",
1385
+ " <td>NaN</td>\n",
1386
+ " <td>NaN</td>\n",
1387
+ " <td>NaN</td>\n",
1388
+ " <td>NaN</td>\n",
1389
+ " <td>NaN</td>\n",
1390
+ " <td>NaN</td>\n",
1391
+ " </tr>\n",
1392
+ " <tr>\n",
1393
+ " <th>Congo, Democratic Republic of</th>\n",
1394
+ " <td>Africa</td>\n",
1395
+ " <td>NaN</td>\n",
1396
+ " <td>NaN</td>\n",
1397
+ " <td>NaN</td>\n",
1398
+ " <td>NaN</td>\n",
1399
+ " <td>NaN</td>\n",
1400
+ " <td>NaN</td>\n",
1401
+ " <td>NaN</td>\n",
1402
+ " <td>NaN</td>\n",
1403
+ " <td>NaN</td>\n",
1404
+ " <td>NaN</td>\n",
1405
+ " </tr>\n",
1406
+ " <tr>\n",
1407
+ " <th>Equatorial Guinea</th>\n",
1408
+ " <td>Africa</td>\n",
1409
+ " <td>NaN</td>\n",
1410
+ " <td>NaN</td>\n",
1411
+ " <td>NaN</td>\n",
1412
+ " <td>NaN</td>\n",
1413
+ " <td>NaN</td>\n",
1414
+ " <td>NaN</td>\n",
1415
+ " <td>NaN</td>\n",
1416
+ " <td>NaN</td>\n",
1417
+ " <td>NaN</td>\n",
1418
+ " <td>NaN</td>\n",
1419
+ " </tr>\n",
1420
+ " <tr>\n",
1421
+ " <th>Eritrea</th>\n",
1422
+ " <td>Africa</td>\n",
1423
+ " <td>NaN</td>\n",
1424
+ " <td>NaN</td>\n",
1425
+ " <td>NaN</td>\n",
1426
+ " <td>NaN</td>\n",
1427
+ " <td>NaN</td>\n",
1428
+ " <td>NaN</td>\n",
1429
+ " <td>NaN</td>\n",
1430
+ " <td>NaN</td>\n",
1431
+ " <td>NaN</td>\n",
1432
+ " <td>NaN</td>\n",
1433
+ " </tr>\n",
1434
+ " <tr>\n",
1435
+ " <th>Guinea-Bissau</th>\n",
1436
+ " <td>Africa</td>\n",
1437
+ " <td>NaN</td>\n",
1438
+ " <td>NaN</td>\n",
1439
+ " <td>NaN</td>\n",
1440
+ " <td>NaN</td>\n",
1441
+ " <td>NaN</td>\n",
1442
+ " <td>NaN</td>\n",
1443
+ " <td>NaN</td>\n",
1444
+ " <td>NaN</td>\n",
1445
+ " <td>NaN</td>\n",
1446
+ " <td>NaN</td>\n",
1447
+ " </tr>\n",
1448
+ " <tr>\n",
1449
+ " <th>Sao Tome and Principe</th>\n",
1450
+ " <td>Africa</td>\n",
1451
+ " <td>NaN</td>\n",
1452
+ " <td>NaN</td>\n",
1453
+ " <td>NaN</td>\n",
1454
+ " <td>NaN</td>\n",
1455
+ " <td>NaN</td>\n",
1456
+ " <td>NaN</td>\n",
1457
+ " <td>NaN</td>\n",
1458
+ " <td>NaN</td>\n",
1459
+ " <td>NaN</td>\n",
1460
+ " <td>NaN</td>\n",
1461
+ " </tr>\n",
1462
+ " <tr>\n",
1463
+ " <th>Seychelles</th>\n",
1464
+ " <td>Africa</td>\n",
1465
+ " <td>NaN</td>\n",
1466
+ " <td>NaN</td>\n",
1467
+ " <td>NaN</td>\n",
1468
+ " <td>NaN</td>\n",
1469
+ " <td>NaN</td>\n",
1470
+ " <td>NaN</td>\n",
1471
+ " <td>NaN</td>\n",
1472
+ " <td>NaN</td>\n",
1473
+ " <td>NaN</td>\n",
1474
+ " <td>NaN</td>\n",
1475
+ " </tr>\n",
1476
+ " <tr>\n",
1477
+ " <th>Brunei</th>\n",
1478
+ " <td>Asia</td>\n",
1479
+ " <td>NaN</td>\n",
1480
+ " <td>NaN</td>\n",
1481
+ " <td>NaN</td>\n",
1482
+ " <td>NaN</td>\n",
1483
+ " <td>NaN</td>\n",
1484
+ " <td>NaN</td>\n",
1485
+ " <td>NaN</td>\n",
1486
+ " <td>NaN</td>\n",
1487
+ " <td>NaN</td>\n",
1488
+ " <td>NaN</td>\n",
1489
+ " </tr>\n",
1490
+ " <tr>\n",
1491
+ " <th>Burma (Myanmar)</th>\n",
1492
+ " <td>Asia</td>\n",
1493
+ " <td>NaN</td>\n",
1494
+ " <td>NaN</td>\n",
1495
+ " <td>NaN</td>\n",
1496
+ " <td>NaN</td>\n",
1497
+ " <td>NaN</td>\n",
1498
+ " <td>NaN</td>\n",
1499
+ " <td>NaN</td>\n",
1500
+ " <td>NaN</td>\n",
1501
+ " <td>NaN</td>\n",
1502
+ " <td>NaN</td>\n",
1503
+ " </tr>\n",
1504
+ " <tr>\n",
1505
+ " <th>East Timor</th>\n",
1506
+ " <td>Asia</td>\n",
1507
+ " <td>NaN</td>\n",
1508
+ " <td>NaN</td>\n",
1509
+ " <td>NaN</td>\n",
1510
+ " <td>NaN</td>\n",
1511
+ " <td>NaN</td>\n",
1512
+ " <td>NaN</td>\n",
1513
+ " <td>NaN</td>\n",
1514
+ " <td>NaN</td>\n",
1515
+ " <td>NaN</td>\n",
1516
+ " <td>NaN</td>\n",
1517
+ " </tr>\n",
1518
+ " <tr>\n",
1519
+ " <th>Korea, North</th>\n",
1520
+ " <td>Asia</td>\n",
1521
+ " <td>NaN</td>\n",
1522
+ " <td>NaN</td>\n",
1523
+ " <td>NaN</td>\n",
1524
+ " <td>NaN</td>\n",
1525
+ " <td>NaN</td>\n",
1526
+ " <td>NaN</td>\n",
1527
+ " <td>NaN</td>\n",
1528
+ " <td>NaN</td>\n",
1529
+ " <td>NaN</td>\n",
1530
+ " <td>NaN</td>\n",
1531
+ " </tr>\n",
1532
+ " <tr>\n",
1533
+ " <th>Korea, South</th>\n",
1534
+ " <td>Asia</td>\n",
1535
+ " <td>NaN</td>\n",
1536
+ " <td>NaN</td>\n",
1537
+ " <td>NaN</td>\n",
1538
+ " <td>NaN</td>\n",
1539
+ " <td>NaN</td>\n",
1540
+ " <td>NaN</td>\n",
1541
+ " <td>NaN</td>\n",
1542
+ " <td>NaN</td>\n",
1543
+ " <td>NaN</td>\n",
1544
+ " <td>NaN</td>\n",
1545
+ " </tr>\n",
1546
+ " <tr>\n",
1547
+ " <th>Russian Federation</th>\n",
1548
+ " <td>Asia</td>\n",
1549
+ " <td>NaN</td>\n",
1550
+ " <td>NaN</td>\n",
1551
+ " <td>NaN</td>\n",
1552
+ " <td>NaN</td>\n",
1553
+ " <td>NaN</td>\n",
1554
+ " <td>NaN</td>\n",
1555
+ " <td>NaN</td>\n",
1556
+ " <td>NaN</td>\n",
1557
+ " <td>NaN</td>\n",
1558
+ " <td>NaN</td>\n",
1559
+ " </tr>\n",
1560
+ " <tr>\n",
1561
+ " <th>Andorra</th>\n",
1562
+ " <td>Europe</td>\n",
1563
+ " <td>NaN</td>\n",
1564
+ " <td>NaN</td>\n",
1565
+ " <td>NaN</td>\n",
1566
+ " <td>NaN</td>\n",
1567
+ " <td>NaN</td>\n",
1568
+ " <td>NaN</td>\n",
1569
+ " <td>NaN</td>\n",
1570
+ " <td>NaN</td>\n",
1571
+ " <td>NaN</td>\n",
1572
+ " <td>NaN</td>\n",
1573
+ " </tr>\n",
1574
+ " <tr>\n",
1575
+ " <th>CZ</th>\n",
1576
+ " <td>Europe</td>\n",
1577
+ " <td>NaN</td>\n",
1578
+ " <td>NaN</td>\n",
1579
+ " <td>NaN</td>\n",
1580
+ " <td>NaN</td>\n",
1581
+ " <td>NaN</td>\n",
1582
+ " <td>NaN</td>\n",
1583
+ " <td>NaN</td>\n",
1584
+ " <td>NaN</td>\n",
1585
+ " <td>NaN</td>\n",
1586
+ " <td>NaN</td>\n",
1587
+ " </tr>\n",
1588
+ " <tr>\n",
1589
+ " <th>Liechtenstein</th>\n",
1590
+ " <td>Europe</td>\n",
1591
+ " <td>NaN</td>\n",
1592
+ " <td>NaN</td>\n",
1593
+ " <td>NaN</td>\n",
1594
+ " <td>NaN</td>\n",
1595
+ " <td>NaN</td>\n",
1596
+ " <td>NaN</td>\n",
1597
+ " <td>NaN</td>\n",
1598
+ " <td>NaN</td>\n",
1599
+ " <td>NaN</td>\n",
1600
+ " <td>NaN</td>\n",
1601
+ " </tr>\n",
1602
+ " <tr>\n",
1603
+ " <th>Macedonia</th>\n",
1604
+ " <td>Europe</td>\n",
1605
+ " <td>NaN</td>\n",
1606
+ " <td>NaN</td>\n",
1607
+ " <td>NaN</td>\n",
1608
+ " <td>NaN</td>\n",
1609
+ " <td>NaN</td>\n",
1610
+ " <td>NaN</td>\n",
1611
+ " <td>NaN</td>\n",
1612
+ " <td>NaN</td>\n",
1613
+ " <td>NaN</td>\n",
1614
+ " <td>NaN</td>\n",
1615
+ " </tr>\n",
1616
+ " <tr>\n",
1617
+ " <th>Monaco</th>\n",
1618
+ " <td>Europe</td>\n",
1619
+ " <td>NaN</td>\n",
1620
+ " <td>NaN</td>\n",
1621
+ " <td>NaN</td>\n",
1622
+ " <td>NaN</td>\n",
1623
+ " <td>NaN</td>\n",
1624
+ " <td>NaN</td>\n",
1625
+ " <td>NaN</td>\n",
1626
+ " <td>NaN</td>\n",
1627
+ " <td>NaN</td>\n",
1628
+ " <td>NaN</td>\n",
1629
+ " </tr>\n",
1630
+ " <tr>\n",
1631
+ " <th>San Marino</th>\n",
1632
+ " <td>Europe</td>\n",
1633
+ " <td>NaN</td>\n",
1634
+ " <td>NaN</td>\n",
1635
+ " <td>NaN</td>\n",
1636
+ " <td>NaN</td>\n",
1637
+ " <td>NaN</td>\n",
1638
+ " <td>NaN</td>\n",
1639
+ " <td>NaN</td>\n",
1640
+ " <td>NaN</td>\n",
1641
+ " <td>NaN</td>\n",
1642
+ " <td>NaN</td>\n",
1643
+ " </tr>\n",
1644
+ " <tr>\n",
1645
+ " <th>Vatican City</th>\n",
1646
+ " <td>Europe</td>\n",
1647
+ " <td>NaN</td>\n",
1648
+ " <td>NaN</td>\n",
1649
+ " <td>NaN</td>\n",
1650
+ " <td>NaN</td>\n",
1651
+ " <td>NaN</td>\n",
1652
+ " <td>NaN</td>\n",
1653
+ " <td>NaN</td>\n",
1654
+ " <td>NaN</td>\n",
1655
+ " <td>NaN</td>\n",
1656
+ " <td>NaN</td>\n",
1657
+ " </tr>\n",
1658
+ " <tr>\n",
1659
+ " <th>Antigua and Barbuda</th>\n",
1660
+ " <td>North America</td>\n",
1661
+ " <td>NaN</td>\n",
1662
+ " <td>NaN</td>\n",
1663
+ " <td>NaN</td>\n",
1664
+ " <td>NaN</td>\n",
1665
+ " <td>NaN</td>\n",
1666
+ " <td>NaN</td>\n",
1667
+ " <td>NaN</td>\n",
1668
+ " <td>NaN</td>\n",
1669
+ " <td>NaN</td>\n",
1670
+ " <td>NaN</td>\n",
1671
+ " </tr>\n",
1672
+ " <tr>\n",
1673
+ " <th>Bahamas</th>\n",
1674
+ " <td>North America</td>\n",
1675
+ " <td>NaN</td>\n",
1676
+ " <td>NaN</td>\n",
1677
+ " <td>NaN</td>\n",
1678
+ " <td>NaN</td>\n",
1679
+ " <td>NaN</td>\n",
1680
+ " <td>NaN</td>\n",
1681
+ " <td>NaN</td>\n",
1682
+ " <td>NaN</td>\n",
1683
+ " <td>NaN</td>\n",
1684
+ " <td>NaN</td>\n",
1685
+ " </tr>\n",
1686
+ " <tr>\n",
1687
+ " <th>Barbados</th>\n",
1688
+ " <td>North America</td>\n",
1689
+ " <td>NaN</td>\n",
1690
+ " <td>NaN</td>\n",
1691
+ " <td>NaN</td>\n",
1692
+ " <td>NaN</td>\n",
1693
+ " <td>NaN</td>\n",
1694
+ " <td>NaN</td>\n",
1695
+ " <td>NaN</td>\n",
1696
+ " <td>NaN</td>\n",
1697
+ " <td>NaN</td>\n",
1698
+ " <td>NaN</td>\n",
1699
+ " </tr>\n",
1700
+ " <tr>\n",
1701
+ " <th>Dominica</th>\n",
1702
+ " <td>North America</td>\n",
1703
+ " <td>NaN</td>\n",
1704
+ " <td>NaN</td>\n",
1705
+ " <td>NaN</td>\n",
1706
+ " <td>NaN</td>\n",
1707
+ " <td>NaN</td>\n",
1708
+ " <td>NaN</td>\n",
1709
+ " <td>NaN</td>\n",
1710
+ " <td>NaN</td>\n",
1711
+ " <td>NaN</td>\n",
1712
+ " <td>NaN</td>\n",
1713
+ " </tr>\n",
1714
+ " <tr>\n",
1715
+ " <th>Grenada</th>\n",
1716
+ " <td>North America</td>\n",
1717
+ " <td>NaN</td>\n",
1718
+ " <td>NaN</td>\n",
1719
+ " <td>NaN</td>\n",
1720
+ " <td>NaN</td>\n",
1721
+ " <td>NaN</td>\n",
1722
+ " <td>NaN</td>\n",
1723
+ " <td>NaN</td>\n",
1724
+ " <td>NaN</td>\n",
1725
+ " <td>NaN</td>\n",
1726
+ " <td>NaN</td>\n",
1727
+ " </tr>\n",
1728
+ " <tr>\n",
1729
+ " <th>Saint Kitts and Nevis</th>\n",
1730
+ " <td>North America</td>\n",
1731
+ " <td>NaN</td>\n",
1732
+ " <td>NaN</td>\n",
1733
+ " <td>NaN</td>\n",
1734
+ " <td>NaN</td>\n",
1735
+ " <td>NaN</td>\n",
1736
+ " <td>NaN</td>\n",
1737
+ " <td>NaN</td>\n",
1738
+ " <td>NaN</td>\n",
1739
+ " <td>NaN</td>\n",
1740
+ " <td>NaN</td>\n",
1741
+ " </tr>\n",
1742
+ " <tr>\n",
1743
+ " <th>Saint Lucia</th>\n",
1744
+ " <td>North America</td>\n",
1745
+ " <td>NaN</td>\n",
1746
+ " <td>NaN</td>\n",
1747
+ " <td>NaN</td>\n",
1748
+ " <td>NaN</td>\n",
1749
+ " <td>NaN</td>\n",
1750
+ " <td>NaN</td>\n",
1751
+ " <td>NaN</td>\n",
1752
+ " <td>NaN</td>\n",
1753
+ " <td>NaN</td>\n",
1754
+ " <td>NaN</td>\n",
1755
+ " </tr>\n",
1756
+ " <tr>\n",
1757
+ " <th>Saint Vincent and the Grenadines</th>\n",
1758
+ " <td>North America</td>\n",
1759
+ " <td>NaN</td>\n",
1760
+ " <td>NaN</td>\n",
1761
+ " <td>NaN</td>\n",
1762
+ " <td>NaN</td>\n",
1763
+ " <td>NaN</td>\n",
1764
+ " <td>NaN</td>\n",
1765
+ " <td>NaN</td>\n",
1766
+ " <td>NaN</td>\n",
1767
+ " <td>NaN</td>\n",
1768
+ " <td>NaN</td>\n",
1769
+ " </tr>\n",
1770
+ " <tr>\n",
1771
+ " <th>US</th>\n",
1772
+ " <td>North America</td>\n",
1773
+ " <td>NaN</td>\n",
1774
+ " <td>NaN</td>\n",
1775
+ " <td>NaN</td>\n",
1776
+ " <td>NaN</td>\n",
1777
+ " <td>NaN</td>\n",
1778
+ " <td>NaN</td>\n",
1779
+ " <td>NaN</td>\n",
1780
+ " <td>NaN</td>\n",
1781
+ " <td>NaN</td>\n",
1782
+ " <td>NaN</td>\n",
1783
+ " </tr>\n",
1784
+ " <tr>\n",
1785
+ " <th>Fiji</th>\n",
1786
+ " <td>Oceania</td>\n",
1787
+ " <td>NaN</td>\n",
1788
+ " <td>NaN</td>\n",
1789
+ " <td>NaN</td>\n",
1790
+ " <td>NaN</td>\n",
1791
+ " <td>NaN</td>\n",
1792
+ " <td>NaN</td>\n",
1793
+ " <td>NaN</td>\n",
1794
+ " <td>NaN</td>\n",
1795
+ " <td>NaN</td>\n",
1796
+ " <td>NaN</td>\n",
1797
+ " </tr>\n",
1798
+ " <tr>\n",
1799
+ " <th>Kiribati</th>\n",
1800
+ " <td>Oceania</td>\n",
1801
+ " <td>NaN</td>\n",
1802
+ " <td>NaN</td>\n",
1803
+ " <td>NaN</td>\n",
1804
+ " <td>NaN</td>\n",
1805
+ " <td>NaN</td>\n",
1806
+ " <td>NaN</td>\n",
1807
+ " <td>NaN</td>\n",
1808
+ " <td>NaN</td>\n",
1809
+ " <td>NaN</td>\n",
1810
+ " <td>NaN</td>\n",
1811
+ " </tr>\n",
1812
+ " <tr>\n",
1813
+ " <th>Marshall Islands</th>\n",
1814
+ " <td>Oceania</td>\n",
1815
+ " <td>NaN</td>\n",
1816
+ " <td>NaN</td>\n",
1817
+ " <td>NaN</td>\n",
1818
+ " <td>NaN</td>\n",
1819
+ " <td>NaN</td>\n",
1820
+ " <td>NaN</td>\n",
1821
+ " <td>NaN</td>\n",
1822
+ " <td>NaN</td>\n",
1823
+ " <td>NaN</td>\n",
1824
+ " <td>NaN</td>\n",
1825
+ " </tr>\n",
1826
+ " <tr>\n",
1827
+ " <th>Micronesia</th>\n",
1828
+ " <td>Oceania</td>\n",
1829
+ " <td>NaN</td>\n",
1830
+ " <td>NaN</td>\n",
1831
+ " <td>NaN</td>\n",
1832
+ " <td>NaN</td>\n",
1833
+ " <td>NaN</td>\n",
1834
+ " <td>NaN</td>\n",
1835
+ " <td>NaN</td>\n",
1836
+ " <td>NaN</td>\n",
1837
+ " <td>NaN</td>\n",
1838
+ " <td>NaN</td>\n",
1839
+ " </tr>\n",
1840
+ " <tr>\n",
1841
+ " <th>Nauru</th>\n",
1842
+ " <td>Oceania</td>\n",
1843
+ " <td>NaN</td>\n",
1844
+ " <td>NaN</td>\n",
1845
+ " <td>NaN</td>\n",
1846
+ " <td>NaN</td>\n",
1847
+ " <td>NaN</td>\n",
1848
+ " <td>NaN</td>\n",
1849
+ " <td>NaN</td>\n",
1850
+ " <td>NaN</td>\n",
1851
+ " <td>NaN</td>\n",
1852
+ " <td>NaN</td>\n",
1853
+ " </tr>\n",
1854
+ " <tr>\n",
1855
+ " <th>Palau</th>\n",
1856
+ " <td>Oceania</td>\n",
1857
+ " <td>NaN</td>\n",
1858
+ " <td>NaN</td>\n",
1859
+ " <td>NaN</td>\n",
1860
+ " <td>NaN</td>\n",
1861
+ " <td>NaN</td>\n",
1862
+ " <td>NaN</td>\n",
1863
+ " <td>NaN</td>\n",
1864
+ " <td>NaN</td>\n",
1865
+ " <td>NaN</td>\n",
1866
+ " <td>NaN</td>\n",
1867
+ " </tr>\n",
1868
+ " <tr>\n",
1869
+ " <th>Papua New Guinea</th>\n",
1870
+ " <td>Oceania</td>\n",
1871
+ " <td>NaN</td>\n",
1872
+ " <td>NaN</td>\n",
1873
+ " <td>NaN</td>\n",
1874
+ " <td>NaN</td>\n",
1875
+ " <td>NaN</td>\n",
1876
+ " <td>NaN</td>\n",
1877
+ " <td>NaN</td>\n",
1878
+ " <td>NaN</td>\n",
1879
+ " <td>NaN</td>\n",
1880
+ " <td>NaN</td>\n",
1881
+ " </tr>\n",
1882
+ " <tr>\n",
1883
+ " <th>Samoa</th>\n",
1884
+ " <td>Oceania</td>\n",
1885
+ " <td>NaN</td>\n",
1886
+ " <td>NaN</td>\n",
1887
+ " <td>NaN</td>\n",
1888
+ " <td>NaN</td>\n",
1889
+ " <td>NaN</td>\n",
1890
+ " <td>NaN</td>\n",
1891
+ " <td>NaN</td>\n",
1892
+ " <td>NaN</td>\n",
1893
+ " <td>NaN</td>\n",
1894
+ " <td>NaN</td>\n",
1895
+ " </tr>\n",
1896
+ " <tr>\n",
1897
+ " <th>Solomon Islands</th>\n",
1898
+ " <td>Oceania</td>\n",
1899
+ " <td>NaN</td>\n",
1900
+ " <td>NaN</td>\n",
1901
+ " <td>NaN</td>\n",
1902
+ " <td>NaN</td>\n",
1903
+ " <td>NaN</td>\n",
1904
+ " <td>NaN</td>\n",
1905
+ " <td>NaN</td>\n",
1906
+ " <td>NaN</td>\n",
1907
+ " <td>NaN</td>\n",
1908
+ " <td>NaN</td>\n",
1909
+ " </tr>\n",
1910
+ " <tr>\n",
1911
+ " <th>Tonga</th>\n",
1912
+ " <td>Oceania</td>\n",
1913
+ " <td>NaN</td>\n",
1914
+ " <td>NaN</td>\n",
1915
+ " <td>NaN</td>\n",
1916
+ " <td>NaN</td>\n",
1917
+ " <td>NaN</td>\n",
1918
+ " <td>NaN</td>\n",
1919
+ " <td>NaN</td>\n",
1920
+ " <td>NaN</td>\n",
1921
+ " <td>NaN</td>\n",
1922
+ " <td>NaN</td>\n",
1923
+ " </tr>\n",
1924
+ " <tr>\n",
1925
+ " <th>Tuvalu</th>\n",
1926
+ " <td>Oceania</td>\n",
1927
+ " <td>NaN</td>\n",
1928
+ " <td>NaN</td>\n",
1929
+ " <td>NaN</td>\n",
1930
+ " <td>NaN</td>\n",
1931
+ " <td>NaN</td>\n",
1932
+ " <td>NaN</td>\n",
1933
+ " <td>NaN</td>\n",
1934
+ " <td>NaN</td>\n",
1935
+ " <td>NaN</td>\n",
1936
+ " <td>NaN</td>\n",
1937
+ " </tr>\n",
1938
+ " <tr>\n",
1939
+ " <th>Vanuatu</th>\n",
1940
+ " <td>Oceania</td>\n",
1941
+ " <td>NaN</td>\n",
1942
+ " <td>NaN</td>\n",
1943
+ " <td>NaN</td>\n",
1944
+ " <td>NaN</td>\n",
1945
+ " <td>NaN</td>\n",
1946
+ " <td>NaN</td>\n",
1947
+ " <td>NaN</td>\n",
1948
+ " <td>NaN</td>\n",
1949
+ " <td>NaN</td>\n",
1950
+ " <td>NaN</td>\n",
1951
+ " </tr>\n",
1952
+ " </tbody>\n",
1953
+ "</table>\n",
1954
+ "</div>"
1955
+ ],
1956
+ "text/plain": [
1957
+ " Continent year Life Ladder \\\n",
1958
+ "Country \n",
1959
+ "Burkina Africa NaN NaN \n",
1960
+ "Cape Verde Africa NaN NaN \n",
1961
+ "Congo Africa NaN NaN \n",
1962
+ "Congo, Democratic Republic of Africa NaN NaN \n",
1963
+ "Equatorial Guinea Africa NaN NaN \n",
1964
+ "Eritrea Africa NaN NaN \n",
1965
+ "Guinea-Bissau Africa NaN NaN \n",
1966
+ "Sao Tome and Principe Africa NaN NaN \n",
1967
+ "Seychelles Africa NaN NaN \n",
1968
+ "Brunei Asia NaN NaN \n",
1969
+ "Burma (Myanmar) Asia NaN NaN \n",
1970
+ "East Timor Asia NaN NaN \n",
1971
+ "Korea, North Asia NaN NaN \n",
1972
+ "Korea, South Asia NaN NaN \n",
1973
+ "Russian Federation Asia NaN NaN \n",
1974
+ "Andorra Europe NaN NaN \n",
1975
+ "CZ Europe NaN NaN \n",
1976
+ "Liechtenstein Europe NaN NaN \n",
1977
+ "Macedonia Europe NaN NaN \n",
1978
+ "Monaco Europe NaN NaN \n",
1979
+ "San Marino Europe NaN NaN \n",
1980
+ "Vatican City Europe NaN NaN \n",
1981
+ "Antigua and Barbuda North America NaN NaN \n",
1982
+ "Bahamas North America NaN NaN \n",
1983
+ "Barbados North America NaN NaN \n",
1984
+ "Dominica North America NaN NaN \n",
1985
+ "Grenada North America NaN NaN \n",
1986
+ "Saint Kitts and Nevis North America NaN NaN \n",
1987
+ "Saint Lucia North America NaN NaN \n",
1988
+ "Saint Vincent and the Grenadines North America NaN NaN \n",
1989
+ "US North America NaN NaN \n",
1990
+ "Fiji Oceania NaN NaN \n",
1991
+ "Kiribati Oceania NaN NaN \n",
1992
+ "Marshall Islands Oceania NaN NaN \n",
1993
+ "Micronesia Oceania NaN NaN \n",
1994
+ "Nauru Oceania NaN NaN \n",
1995
+ "Palau Oceania NaN NaN \n",
1996
+ "Papua New Guinea Oceania NaN NaN \n",
1997
+ "Samoa Oceania NaN NaN \n",
1998
+ "Solomon Islands Oceania NaN NaN \n",
1999
+ "Tonga Oceania NaN NaN \n",
2000
+ "Tuvalu Oceania NaN NaN \n",
2001
+ "Vanuatu Oceania NaN NaN \n",
2002
+ "\n",
2003
+ " Log GDP per capita Social support \\\n",
2004
+ "Country \n",
2005
+ "Burkina NaN NaN \n",
2006
+ "Cape Verde NaN NaN \n",
2007
+ "Congo NaN NaN \n",
2008
+ "Congo, Democratic Republic of NaN NaN \n",
2009
+ "Equatorial Guinea NaN NaN \n",
2010
+ "Eritrea NaN NaN \n",
2011
+ "Guinea-Bissau NaN NaN \n",
2012
+ "Sao Tome and Principe NaN NaN \n",
2013
+ "Seychelles NaN NaN \n",
2014
+ "Brunei NaN NaN \n",
2015
+ "Burma (Myanmar) NaN NaN \n",
2016
+ "East Timor NaN NaN \n",
2017
+ "Korea, North NaN NaN \n",
2018
+ "Korea, South NaN NaN \n",
2019
+ "Russian Federation NaN NaN \n",
2020
+ "Andorra NaN NaN \n",
2021
+ "CZ NaN NaN \n",
2022
+ "Liechtenstein NaN NaN \n",
2023
+ "Macedonia NaN NaN \n",
2024
+ "Monaco NaN NaN \n",
2025
+ "San Marino NaN NaN \n",
2026
+ "Vatican City NaN NaN \n",
2027
+ "Antigua and Barbuda NaN NaN \n",
2028
+ "Bahamas NaN NaN \n",
2029
+ "Barbados NaN NaN \n",
2030
+ "Dominica NaN NaN \n",
2031
+ "Grenada NaN NaN \n",
2032
+ "Saint Kitts and Nevis NaN NaN \n",
2033
+ "Saint Lucia NaN NaN \n",
2034
+ "Saint Vincent and the Grenadines NaN NaN \n",
2035
+ "US NaN NaN \n",
2036
+ "Fiji NaN NaN \n",
2037
+ "Kiribati NaN NaN \n",
2038
+ "Marshall Islands NaN NaN \n",
2039
+ "Micronesia NaN NaN \n",
2040
+ "Nauru NaN NaN \n",
2041
+ "Palau NaN NaN \n",
2042
+ "Papua New Guinea NaN NaN \n",
2043
+ "Samoa NaN NaN \n",
2044
+ "Solomon Islands NaN NaN \n",
2045
+ "Tonga NaN NaN \n",
2046
+ "Tuvalu NaN NaN \n",
2047
+ "Vanuatu NaN NaN \n",
2048
+ "\n",
2049
+ " Healthy life expectancy at birth \\\n",
2050
+ "Country \n",
2051
+ "Burkina NaN \n",
2052
+ "Cape Verde NaN \n",
2053
+ "Congo NaN \n",
2054
+ "Congo, Democratic Republic of NaN \n",
2055
+ "Equatorial Guinea NaN \n",
2056
+ "Eritrea NaN \n",
2057
+ "Guinea-Bissau NaN \n",
2058
+ "Sao Tome and Principe NaN \n",
2059
+ "Seychelles NaN \n",
2060
+ "Brunei NaN \n",
2061
+ "Burma (Myanmar) NaN \n",
2062
+ "East Timor NaN \n",
2063
+ "Korea, North NaN \n",
2064
+ "Korea, South NaN \n",
2065
+ "Russian Federation NaN \n",
2066
+ "Andorra NaN \n",
2067
+ "CZ NaN \n",
2068
+ "Liechtenstein NaN \n",
2069
+ "Macedonia NaN \n",
2070
+ "Monaco NaN \n",
2071
+ "San Marino NaN \n",
2072
+ "Vatican City NaN \n",
2073
+ "Antigua and Barbuda NaN \n",
2074
+ "Bahamas NaN \n",
2075
+ "Barbados NaN \n",
2076
+ "Dominica NaN \n",
2077
+ "Grenada NaN \n",
2078
+ "Saint Kitts and Nevis NaN \n",
2079
+ "Saint Lucia NaN \n",
2080
+ "Saint Vincent and the Grenadines NaN \n",
2081
+ "US NaN \n",
2082
+ "Fiji NaN \n",
2083
+ "Kiribati NaN \n",
2084
+ "Marshall Islands NaN \n",
2085
+ "Micronesia NaN \n",
2086
+ "Nauru NaN \n",
2087
+ "Palau NaN \n",
2088
+ "Papua New Guinea NaN \n",
2089
+ "Samoa NaN \n",
2090
+ "Solomon Islands NaN \n",
2091
+ "Tonga NaN \n",
2092
+ "Tuvalu NaN \n",
2093
+ "Vanuatu NaN \n",
2094
+ "\n",
2095
+ " Freedom to make life choices Generosity \\\n",
2096
+ "Country \n",
2097
+ "Burkina NaN NaN \n",
2098
+ "Cape Verde NaN NaN \n",
2099
+ "Congo NaN NaN \n",
2100
+ "Congo, Democratic Republic of NaN NaN \n",
2101
+ "Equatorial Guinea NaN NaN \n",
2102
+ "Eritrea NaN NaN \n",
2103
+ "Guinea-Bissau NaN NaN \n",
2104
+ "Sao Tome and Principe NaN NaN \n",
2105
+ "Seychelles NaN NaN \n",
2106
+ "Brunei NaN NaN \n",
2107
+ "Burma (Myanmar) NaN NaN \n",
2108
+ "East Timor NaN NaN \n",
2109
+ "Korea, North NaN NaN \n",
2110
+ "Korea, South NaN NaN \n",
2111
+ "Russian Federation NaN NaN \n",
2112
+ "Andorra NaN NaN \n",
2113
+ "CZ NaN NaN \n",
2114
+ "Liechtenstein NaN NaN \n",
2115
+ "Macedonia NaN NaN \n",
2116
+ "Monaco NaN NaN \n",
2117
+ "San Marino NaN NaN \n",
2118
+ "Vatican City NaN NaN \n",
2119
+ "Antigua and Barbuda NaN NaN \n",
2120
+ "Bahamas NaN NaN \n",
2121
+ "Barbados NaN NaN \n",
2122
+ "Dominica NaN NaN \n",
2123
+ "Grenada NaN NaN \n",
2124
+ "Saint Kitts and Nevis NaN NaN \n",
2125
+ "Saint Lucia NaN NaN \n",
2126
+ "Saint Vincent and the Grenadines NaN NaN \n",
2127
+ "US NaN NaN \n",
2128
+ "Fiji NaN NaN \n",
2129
+ "Kiribati NaN NaN \n",
2130
+ "Marshall Islands NaN NaN \n",
2131
+ "Micronesia NaN NaN \n",
2132
+ "Nauru NaN NaN \n",
2133
+ "Palau NaN NaN \n",
2134
+ "Papua New Guinea NaN NaN \n",
2135
+ "Samoa NaN NaN \n",
2136
+ "Solomon Islands NaN NaN \n",
2137
+ "Tonga NaN NaN \n",
2138
+ "Tuvalu NaN NaN \n",
2139
+ "Vanuatu NaN NaN \n",
2140
+ "\n",
2141
+ " Perceptions of corruption Positive affect \\\n",
2142
+ "Country \n",
2143
+ "Burkina NaN NaN \n",
2144
+ "Cape Verde NaN NaN \n",
2145
+ "Congo NaN NaN \n",
2146
+ "Congo, Democratic Republic of NaN NaN \n",
2147
+ "Equatorial Guinea NaN NaN \n",
2148
+ "Eritrea NaN NaN \n",
2149
+ "Guinea-Bissau NaN NaN \n",
2150
+ "Sao Tome and Principe NaN NaN \n",
2151
+ "Seychelles NaN NaN \n",
2152
+ "Brunei NaN NaN \n",
2153
+ "Burma (Myanmar) NaN NaN \n",
2154
+ "East Timor NaN NaN \n",
2155
+ "Korea, North NaN NaN \n",
2156
+ "Korea, South NaN NaN \n",
2157
+ "Russian Federation NaN NaN \n",
2158
+ "Andorra NaN NaN \n",
2159
+ "CZ NaN NaN \n",
2160
+ "Liechtenstein NaN NaN \n",
2161
+ "Macedonia NaN NaN \n",
2162
+ "Monaco NaN NaN \n",
2163
+ "San Marino NaN NaN \n",
2164
+ "Vatican City NaN NaN \n",
2165
+ "Antigua and Barbuda NaN NaN \n",
2166
+ "Bahamas NaN NaN \n",
2167
+ "Barbados NaN NaN \n",
2168
+ "Dominica NaN NaN \n",
2169
+ "Grenada NaN NaN \n",
2170
+ "Saint Kitts and Nevis NaN NaN \n",
2171
+ "Saint Lucia NaN NaN \n",
2172
+ "Saint Vincent and the Grenadines NaN NaN \n",
2173
+ "US NaN NaN \n",
2174
+ "Fiji NaN NaN \n",
2175
+ "Kiribati NaN NaN \n",
2176
+ "Marshall Islands NaN NaN \n",
2177
+ "Micronesia NaN NaN \n",
2178
+ "Nauru NaN NaN \n",
2179
+ "Palau NaN NaN \n",
2180
+ "Papua New Guinea NaN NaN \n",
2181
+ "Samoa NaN NaN \n",
2182
+ "Solomon Islands NaN NaN \n",
2183
+ "Tonga NaN NaN \n",
2184
+ "Tuvalu NaN NaN \n",
2185
+ "Vanuatu NaN NaN \n",
2186
+ "\n",
2187
+ " Negative affect \n",
2188
+ "Country \n",
2189
+ "Burkina NaN \n",
2190
+ "Cape Verde NaN \n",
2191
+ "Congo NaN \n",
2192
+ "Congo, Democratic Republic of NaN \n",
2193
+ "Equatorial Guinea NaN \n",
2194
+ "Eritrea NaN \n",
2195
+ "Guinea-Bissau NaN \n",
2196
+ "Sao Tome and Principe NaN \n",
2197
+ "Seychelles NaN \n",
2198
+ "Brunei NaN \n",
2199
+ "Burma (Myanmar) NaN \n",
2200
+ "East Timor NaN \n",
2201
+ "Korea, North NaN \n",
2202
+ "Korea, South NaN \n",
2203
+ "Russian Federation NaN \n",
2204
+ "Andorra NaN \n",
2205
+ "CZ NaN \n",
2206
+ "Liechtenstein NaN \n",
2207
+ "Macedonia NaN \n",
2208
+ "Monaco NaN \n",
2209
+ "San Marino NaN \n",
2210
+ "Vatican City NaN \n",
2211
+ "Antigua and Barbuda NaN \n",
2212
+ "Bahamas NaN \n",
2213
+ "Barbados NaN \n",
2214
+ "Dominica NaN \n",
2215
+ "Grenada NaN \n",
2216
+ "Saint Kitts and Nevis NaN \n",
2217
+ "Saint Lucia NaN \n",
2218
+ "Saint Vincent and the Grenadines NaN \n",
2219
+ "US NaN \n",
2220
+ "Fiji NaN \n",
2221
+ "Kiribati NaN \n",
2222
+ "Marshall Islands NaN \n",
2223
+ "Micronesia NaN \n",
2224
+ "Nauru NaN \n",
2225
+ "Palau NaN \n",
2226
+ "Papua New Guinea NaN \n",
2227
+ "Samoa NaN \n",
2228
+ "Solomon Islands NaN \n",
2229
+ "Tonga NaN \n",
2230
+ "Tuvalu NaN \n",
2231
+ "Vanuatu NaN "
2232
+ ]
2233
+ },
2234
+ "execution_count": 88,
2235
+ "metadata": {},
2236
+ "output_type": "execute_result"
2237
+ }
2238
+ ],
2239
+ "source": [
2240
+ "df3"
2241
+ ]
2242
+ },
2243
+ {
2244
+ "cell_type": "markdown",
2245
+ "id": "db01b828-d1b1-4708-b6bd-3b2dbed54746",
2246
+ "metadata": {},
2247
+ "source": [
2248
+ "> Note that I updated these in the spreadsheet manually with Excel because it was faster to do it by hand... I should go back when I have time to do it programmatically..."
2249
+ ]
2250
+ }
2251
+ ],
2252
+ "metadata": {
2253
+ "kernelspec": {
2254
+ "display_name": "Python 3 (ipykernel)",
2255
+ "language": "python",
2256
+ "name": "python3"
2257
+ },
2258
+ "language_info": {
2259
+ "codemirror_mode": {
2260
+ "name": "ipython",
2261
+ "version": 3
2262
+ },
2263
+ "file_extension": ".py",
2264
+ "mimetype": "text/x-python",
2265
+ "name": "python",
2266
+ "nbconvert_exporter": "python",
2267
+ "pygments_lexer": "ipython3",
2268
+ "version": "3.8.8"
2269
+ }
2270
+ },
2271
+ "nbformat": 4,
2272
+ "nbformat_minor": 5
2273
+ }
Assets/Countries/combined-countries.csv ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Words,year,Life Ladder,Log GDP per capita,Social support,Healthy life expectancy at birth,Freedom to make life choices,Generosity,Perceptions of corruption,Positive affect,Negative affect,Categories
2
+ Afghanistan,2019,2.375091791,7.697247982,0.419972867,52.40000153,0.393656164,-0.108458869,0.923849106,0.351387054,0.502473712,Asia
3
+ Albania,2020,5.364909649,9.497251511,0.710115016,69.30000305,0.75367105,0.006968025,0.891358972,0.678661227,0.265066117,Europe
4
+ Algeria,2019,4.744627476,9.336946487,0.803258657,66.09999847,0.385083437,0.00508652,0.740609348,0.584944308,0.215197757,Africa
5
+ Andorra,,,,,,,,,,,Europe
6
+ Angola,2014,3.794837952,9.016735077,0.754615486,54.59999847,0.374541551,-0.167722687,0.83407563,0.578517139,0.367864132,Africa
7
+ Antigua and Barbuda,,,,,,,,,,,North America
8
+ Argentina,2020,5.900567055,9.850449562,0.897103846,69.19999695,0.823391616,-0.122354329,0.815780461,0.763523877,0.342496932,South America
9
+ Armenia,2019,5.4880867,9.521769524,0.781603873,67.19999695,0.844324112,-0.172368988,0.583472729,0.598237813,0.430463403,Europe
10
+ Australia,2020,7.137367725,10.75986385,0.936517,74.19999695,0.905282974,0.210030302,0.491094828,0.769181728,0.205077678,Oceania
11
+ Austria,2020,7.213489056,10.85111809,0.924831212,73.59999847,0.911909878,0.011031743,0.463830173,0.769316614,0.206499651,Europe
12
+ Azerbaijan,2019,5.173389435,9.575250626,0.88675642,65.80000305,0.854248524,-0.214162916,0.457260668,0.642546833,0.163920254,Europe
13
+ Bahamas,,,,,,,,,,,North America
14
+ Bahrain,2020,6.173175812,10.61990356,0.847745061,69.69999695,0.94523257,0.132441044,,0.789794981,0.296835452,Asia
15
+ Bangladesh,2020,5.279986858,8.472194672,0.739337921,65.30000305,0.777467191,-0.008851291,0.741659164,0.582380831,0.331708789,Asia
16
+ Barbados,,,,,,,,,,,North America
17
+ Belarus,2019,5.821453094,9.860038757,0.916740477,66.40000153,0.656933606,-0.185933307,0.545904756,0.590850592,0.189821407,Europe
18
+ Belgium,2020,6.838760853,10.77053738,0.903558671,72.40000153,0.766917825,-0.163784489,0.633626759,0.646510303,0.260188788,Europe
19
+ Belize,2014,5.955646515,8.883127213,0.756932497,62.22000122,0.873569071,0.021995628,0.782105386,0.754977345,0.281604409,North America
20
+ Benin,2020,4.407745838,8.102292061,0.506636083,55.09999847,0.783114672,-0.08348871,0.531883657,0.608584642,0.304512441,Africa
21
+ Bhutan,2015,5.082128525,9.218923569,0.847574413,60.20000076,0.83010155,0.277412355,0.633955777,0.80964148,0.311589301,Asia
22
+ Bolivia,2020,5.559258938,8.997989655,0.804810882,64.19999695,0.877031922,-0.053763788,0.868208289,0.789818466,0.381791174,South America
23
+ Bosnia and Herzegovina,2020,5.515816212,9.58334446,0.898518682,68.40000153,0.740250826,0.137954175,0.916052163,0.644237339,0.325412303,Europe
24
+ Botswana,2019,3.471084833,9.785069466,0.773667216,59.59999847,0.832542658,-0.239000931,0.792079508,0.711796343,0.272721767,Africa
25
+ Brazil,2020,6.109717846,9.522140503,0.830832124,66.80000305,0.786235094,-0.052820019,0.728772223,0.692023873,0.38913855,South America
26
+ Brunei,,,,,,,,,,,Asia
27
+ Bulgaria,2020,5.597723007,9.990657806,0.916242361,67.19999695,0.818224788,-0.004322314,0.900632977,0.705834627,0.221351057,Europe
28
+ Burkina Faso,2019,4.740892887,7.691488266,0.683102369,54.40000153,0.677546859,-0.004089894,0.729396582,0.690925896,0.364775389,Africa
29
+ Burundi,2018,3.775283098,6.635322094,0.484715223,53.40000153,0.646398604,-0.023876166,0.598607659,0.6664415,0.362766594,Africa
30
+ Cambodia,2020,4.376985073,8.361935616,0.724422634,62.40000153,0.963075459,0.052429765,0.863053977,0.877953529,0.38985163,Asia
31
+ Cameroon,2020,5.2410779,8.17463398,0.720046639,54.29999924,0.674509168,0.049266182,0.836517215,0.629614651,0.386478961,Africa
32
+ Canada,2020,7.024904728,10.72951412,0.930610716,74,0.8868922,0.049636856,0.434012353,0.795948744,0.306673735,North America
33
+ Central African Republic,2017,3.475862026,6.81651926,0.319589138,45.20000076,0.645252347,0.0727861,0.889566004,0.613865197,0.599335492,Africa
34
+ Chad,2019,4.250799179,7.364943981,0.640452087,48.70000076,0.537245691,0.055000938,0.832283497,0.587211192,0.460061282,Africa
35
+ Chile,2020,6.150642872,10.0201416,0.888412297,70.09999847,0.781383574,0.032990757,0.811818838,0.814602733,0.336028606,South America
36
+ China,2020,5.771064758,9.70175457,0.80833447,69.90000153,0.891122997,-0.103214338,,0.789345384,0.244918227,Asia
37
+ Colombia,2020,5.70917511,9.495491028,0.797035217,68.30000305,0.840186119,-0.084642209,0.807964027,0.795132697,0.340158582,South America
38
+ Comoros,2019,4.608616352,8.03313446,0.632012963,57.5,0.538261533,0.077253081,0.762232482,0.736221731,0.336162895,Africa
39
+ Congo (Brazzaville),2019,5.212622643,8.101092339,0.624768078,58.5,0.686451972,-0.046051238,0.74058944,0.645253956,0.40504083,Africa
40
+ Congo (Kinshasa),2017,4.311033249,6.965845585,0.669688404,52.90000153,0.704239547,0.068378173,0.809181869,0.550525904,0.404262066,Africa
41
+ Costa Rica,2019,6.997618675,9.885446548,0.906077445,71.5,0.926830113,-0.145994335,0.835628331,0.848347604,0.303327233,North America
42
+ Croatia,2020,6.507992268,10.16581726,0.922913492,71.40000153,0.836657643,-0.062968105,0.960939288,0.742780507,0.285609752,Europe
43
+ Cuba,2006,5.417868614,,0.969595134,68.44000244,0.281457931,,,0.646711767,0.276601523,North America
44
+ Cyprus,2020,6.259810448,,0.805559397,74.09999847,0.762782335,,0.816231728,0.758863032,0.283522457,Europe
45
+ North Cyprus,2019,5.4666152,,0.803294539,,0.792734623,,0.640058875,0.493692875,0.296411127,Asia
46
+ Czech Republic,2020,6.897091389,10.5301342,0.96405369,71.30000305,0.906422019,-0.127022371,0.883699596,0.832057655,0.290441692,Europe
47
+ Denmark,2020,7.514631271,10.90999508,0.947371364,73,0.937931836,0.052293025,0.213841751,0.81766367,0.227101892,Europe
48
+ Djibouti,2011,4.369193554,7.880099297,0.632973254,54.70000076,0.746439457,-0.057318915,0.518930137,0.579302847,0.180592626,Africa
49
+ Dominican Republic,2020,5.168409824,9.802446365,0.806117654,66.40000153,0.834642947,-0.127834037,0.636116564,0.73386693,0.313928306,North America
50
+ East Timor,,,,,,,,,,,Asia
51
+ Ecuador,2020,5.35446167,9.243865013,0.804008543,69.09999847,0.828511536,-0.157090038,0.854780495,0.789940715,0.416027963,South America
52
+ Egypt,2020,4.472396851,9.382726669,0.672725499,62.29999924,0.769550323,-0.112341978,,0.598908663,0.442033589,Africa
53
+ El Salvador,2020,5.461926937,9.018845558,0.695624352,66.69999695,0.923944831,-0.1264745,0.583036363,0.838904202,0.329439789,North America
54
+ Equatorial Guinea,,,,,,,,,,,Africa
55
+ Eritrea,,,,,,,,,,,Africa
56
+ Estonia,2020,6.452563763,10.4585886,0.957770467,69,0.954200566,-0.082279153,0.397834778,0.806923807,0.187679499,Europe
57
+ Ethiopia,2020,4.549219608,7.7109828,0.823137581,59.5,0.768694282,0.188496858,0.783822417,0.669388652,0.251514345,Africa
58
+ Fiji,,,,,,,,,,,Oceania
59
+ Finland,2020,7.889349937,10.75044632,0.961620748,72.09999847,0.962423682,-0.115531988,0.163635895,0.7442922,0.192897573,Europe
60
+ France,2020,6.714111805,10.64328003,0.947354019,74.19999695,0.823386312,-0.168960527,0.564640582,0.731813908,0.23095043,Europe
61
+ Gabon,2019,4.914393425,9.607087135,0.763051689,60.20000076,0.736349881,-0.202519819,0.84625423,0.692702413,0.412960976,Africa
62
+ Gambia,2019,5.163627148,7.69934988,0.693870127,55.29999924,0.676595271,0.410180479,0.798108101,0.772816181,0.400723279,Africa
63
+ Georgia,2020,5.123143196,9.569304466,0.71834594,64.09999847,0.764352381,-0.221125469,0.582734704,0.610894918,0.294512063,Europe
64
+ Germany,2020,7.311897755,10.83349895,0.905080497,72.80000305,0.864356041,-0.06004804,0.424088776,0.759594321,0.205927119,Europe
65
+ Ghana,2020,5.31948328,8.589605331,0.642703354,58,0.823720038,0.199632064,0.847024918,0.712765932,0.252728432,Africa
66
+ Greece,2020,5.787615776,10.21457958,0.778536558,72.80000305,0.56461364,-0.24080646,0.764324546,0.684457839,0.321684211,Europe
67
+ Grenada,,,,,,,,,,,North America
68
+ Guatemala,2019,6.262175083,9.063875198,0.774074376,65.09999847,0.90067631,-0.062302988,0.772577941,0.85941267,0.310789257,North America
69
+ Guinea,2019,4.76768446,7.849340439,0.655124187,55.5,0.691399097,0.09681724,0.755585492,0.684646904,0.473388433,Africa
70
+ Guyana,2007,5.992826462,8.773288727,0.848765194,57.25999832,0.694005668,0.110037036,0.835569084,0.767540574,0.29641977,South America
71
+ Haiti,2018,3.614928007,7.477138042,0.537975907,55.70000076,0.591468394,0.421520352,0.720444739,0.5841133,0.358720034,North America
72
+ Honduras,2019,5.930051327,8.65311718,0.797148347,67.40000153,0.846190035,0.062708922,0.814962924,0.849954963,0.278882086,North America
73
+ Hong Kong,2020,5.295341492,,0.812942982,,0.705452263,,0.380351216,0.608647346,0.210313618,Asia
74
+ Hungary,2020,6.038049698,10.33514786,0.943400383,68.40000153,0.77096808,-0.120404616,0.836105108,0.735238373,0.24005194,Europe
75
+ Iceland,2020,7.575489521,10.82420063,0.983286083,73,0.948627174,0.160273999,0.64406389,0.863017619,0.171795145,Europe
76
+ India,2020,4.225281239,8.702772141,0.616639256,60.90000153,0.906391323,0.074823797,0.780124009,0.752433956,0.383162528,Asia
77
+ Indonesia,2019,5.346512794,9.376888275,0.80191803,62.29999924,0.865859151,0.555348039,0.860784769,0.876714051,0.301702797,Asia
78
+ Iran,2020,4.864528179,,0.757218659,66.59999847,0.599594474,,0.70990169,0.582420528,0.470245004,Asia
79
+ Iraq,2020,4.78516531,9.167185783,0.707847476,61.40000153,0.700214565,-0.020748287,0.849108756,0.644464254,0.531538904,Asia
80
+ Ireland,2020,7.034930706,11.3228035,0.960311055,72.5,0.882098258,0.013816552,0.355632722,0.796661019,0.246447265,Europe
81
+ Israel,2020,7.194928169,10.53805351,0.959072173,73.69999695,0.831315815,-0.049371675,0.74763906,0.62139833,0.242825732,Asia
82
+ Italy,2020,6.488356113,10.56257153,0.889824033,74,0.718155444,-0.149937257,0.844094574,0.670213342,0.311002165,Europe
83
+ Ivory Coast,2020,5.256503582,8.564923286,0.61310631,50.70000076,0.769998014,0.015563689,0.776687264,0.692646921,0.33991909,Africa
84
+ Jamaica,2019,6.309238911,9.186201096,0.877814472,67.5,0.890670836,-0.136797056,0.885330021,0.752041101,0.195284143,North America
85
+ Japan,2020,6.117963314,10.57954788,0.887249112,75.19999695,0.806036115,-0.258745283,0.608698547,0.74246943,0.186461002,Asia
86
+ Jordan,2020,4.093991756,9.14999485,0.708839893,67.19999695,0.778533459,-0.149825886,,,,Asia
87
+ Kazakhstan,2020,6.168269157,10.13533592,0.966448963,65.80000305,0.872100115,-0.056175169,0.660798848,0.684102654,0.150359914,Asia
88
+ Kenya,2020,4.546584129,8.365282059,0.673717618,61.29999924,0.702034473,0.259969592,0.836516023,0.733434856,0.296980411,Africa
89
+ Kiribati,,,,,,,,,,,Oceania
90
+ Kosovo,2020,6.294414043,,0.792374492,,0.879837573,,0.90989387,0.72623986,0.201458037,Europe
91
+ Kuwait,2019,6.106119633,10.81669617,0.841519773,66.90000153,0.867273808,-0.104161076,,0.695362747,0.302876323,Asia
92
+ Kyrgyzstan,2020,6.249586105,8.503411293,0.902222991,64.69999695,0.934885323,0.102865741,0.931317508,0.803025365,0.257813066,Asia
93
+ Laos,2020,5.284390926,8.959955215,0.660396278,59.5,0.915028214,0.141430691,0.747997701,0.821680248,0.358349264,Asia
94
+ Latvia,2020,6.229008675,10.29959011,0.928012192,67.40000153,0.820111692,-0.077660471,0.808821976,0.713628411,0.201582372,Europe
95
+ Lebanon,2019,4.024219513,9.596782684,0.865968525,67.59999847,0.447001487,-0.081082396,0.890415609,0.321689755,0.494499028,Asia
96
+ Lesotho,2019,3.5117805,7.925776958,0.789705396,48.70000076,0.716313541,-0.130536228,0.914951444,0.734879911,0.273425519,Africa
97
+ Liberia,2019,5.121460915,7.263903618,0.71247375,56.90000153,0.705874562,0.050611626,0.828468978,0.635608971,0.389132589,Africa
98
+ Libya,2019,5.33022213,9.627349854,0.826719344,62.29999924,0.761964321,-0.072672851,0.68641299,0.70874089,0.400737435,Africa
99
+ Liechtenstein,,,,,,,,,,,Europe
100
+ Lithuania,2020,6.39137888,10.5036068,0.952544093,68.5,0.824060559,-0.121781312,0.829204798,0.660229564,0.201912001,Europe
101
+ Luxembourg,2019,7.404015541,11.64816856,0.912104547,72.59999847,0.930321217,-0.045057613,0.389598429,0.789186358,0.211639807,Europe
102
+ Macedonia,,,,,,,,,,,Europe
103
+ Madagascar,2019,4.339087486,7.406237125,0.700610101,59.5,0.549535215,-0.012468655,0.719982684,0.723194659,0.303959668,Africa
104
+ Malawi,2019,3.869123697,6.965763092,0.548956096,58.29999924,0.764864206,0.003596819,0.680247962,0.53669703,0.348162442,Africa
105
+ Malaysia,2019,5.427954197,10.25240326,0.842498839,67.19999695,0.915778697,0.123324133,0.781943917,0.834177494,0.176071689,Asia
106
+ Maldives,2018,5.197574615,9.825985909,0.913315058,70.59999847,0.854759276,0.023997834,,,,Asia
107
+ Mali,2019,4.98799181,7.752494812,0.754558086,52.20000076,0.67040509,-0.037851758,0.846340001,0.711522698,0.357764512,Africa
108
+ Malta,2020,6.156822681,,0.937920272,72.19999695,0.930600464,,0.67462635,0.601495862,0.410913229,Europe
109
+ Marshall Islands,,,,,,,,,,,Oceania
110
+ Mauritania,2019,4.152619362,8.5558424,0.798101962,57.29999924,0.627505183,-0.101856656,0.742890298,0.69183147,0.259738505,Africa
111
+ Mauritius,2020,6.015300274,9.972017288,0.892565966,67,0.842598081,-0.03669272,0.771790087,0.766984463,0.138401791,Africa
112
+ Mexico,2020,5.964221001,9.782189369,0.778816223,68.90000153,0.873346984,-0.119389862,0.778165877,0.810109138,0.29155612,North America
113
+ Micronesia,,,,,,,,,,,Oceania
114
+ Moldova,2020,5.811628819,9.462109566,0.874061763,66.40000153,0.859083235,-0.058278579,0.941438973,0.727224529,0.267836064,Europe
115
+ Monaco,,,,,,,,,,,Europe
116
+ Mongolia,2020,6.011364937,9.395559311,0.917789161,62.70000076,0.718491018,0.141357452,0.842827678,0.636443496,0.259983033,Asia
117
+ Montenegro,2020,5.722162724,9.912668228,0.887129486,68.90000153,0.801855087,0.059815772,0.844687104,0.60328269,0.411377817,Europe
118
+ Morocco,2020,4.80261755,8.87091732,0.552520096,66.5,0.818995237,-0.228577554,0.802740276,0.587182403,0.256431192,Africa
119
+ Mozambique,2019,4.932132721,7.154966831,0.742303729,55.20000076,0.869810224,0.072745018,0.681900442,0.58727473,0.384122759,Africa
120
+ Myanmar,2020,4.431364059,8.55391407,0.795763254,59.59999847,0.824870706,0.470258176,0.646702111,0.799749196,0.289218217,Asia
121
+ Namibia,2020,4.451010227,9.104139328,0.740570307,57.09999847,0.665681958,-0.103880182,0.810354829,0.647919536,0.247542083,Africa
122
+ Nauru,,,,,,,,,,,Oceania
123
+ Nepal,2019,5.448724747,8.136457443,0.772273064,64.59999847,0.790347695,0.166975796,0.711842477,0.535798132,0.357100308,Asia
124
+ Netherlands,2020,7.504447937,10.9005003,0.943956137,72.5,0.934522629,0.151298046,0.280604511,0.783990622,0.246511325,Europe
125
+ New Zealand,2020,7.257381916,10.60045719,0.951990783,73.59999847,0.918154597,0.125259653,0.282767951,0.849415004,0.208541051,Oceania
126
+ Nicaragua,2019,6.112545013,8.595469475,0.873863935,67.80000305,0.882678449,0.029247265,0.62198174,0.83542347,0.337012976,North America
127
+ Niger,2019,5.003544331,7.105849266,0.67695874,54,0.83136189,0.02595989,0.728855133,0.815915167,0.304438263,Africa
128
+ Nigeria,2020,5.502948284,8.484203339,0.739289463,50.5,0.713061512,0.099404059,0.912774444,0.743977726,0.315886825,Africa
129
+ North Korea,,,,,,,,,,,Asia
130
+ North Macedonia,2020,5.053664207,9.690014839,0.750374198,65.55988312,0.787284732,0.131274343,0.877421141,0.604626834,0.365126073,Europe
131
+ Norway,2020,7.290032387,11.04216003,0.955979943,73.40000153,0.964561105,0.075148538,0.271083295,0.823093832,0.216033921,Europe
132
+ Oman,2011,6.852982044,10.38246155,,65.5,0.916293025,0.024908492,,,0.295164108,Asia
133
+ Pakistan,2019,4.442717552,8.453290939,0.617295742,58.90000153,0.684675574,0.123729475,0.775998056,0.581067383,0.424240083,Asia
134
+ Palau,,,,,,,,,,,Oceania
135
+ Palestinian Territories,2019,4.48253727,,0.832550049,,0.653488278,,0.829282761,0.62517643,0.3996723,Asia
136
+ Panama,2019,6.085955143,10.35643101,0.885721385,69.69999695,0.882961094,-0.198984995,0.868827522,0.877561629,0.243566602,North America
137
+ Papua New Guinea,,,,,,,,,,,Oceania
138
+ Paraguay,2019,5.652625561,9.448143959,0.892487168,65.90000153,0.876052618,0.028112838,0.881786108,0.85772413,0.275186718,South America
139
+ Peru,2019,5.999381542,9.460934639,0.809075952,68.40000153,0.814805925,-0.129735783,0.873601913,0.820448101,0.374985486,South America
140
+ Philippines,2020,5.079585075,9.061443329,0.781140387,62.09999847,0.932041705,-0.115542881,0.744283676,0.803562105,0.326889008,Asia
141
+ Poland,2020,6.139455318,10.37120342,0.95317173,70.09999847,0.767428696,-0.006559356,0.786873639,0.759842575,0.328937918,Europe
142
+ Portugal,2020,5.767792225,10.37082005,0.874990344,72.80000305,0.91313076,-0.238090202,0.867157161,0.647768855,0.382812679,Europe
143
+ Qatar,2015,6.374529362,11.48561478,,68.30000305,,,,,,Asia
144
+ Romania,2019,6.129942417,10.30591393,0.841905951,67.5,0.84754318,-0.221422106,0.954130709,0.697443366,0.243659228,Europe
145
+ Russia,2020,5.495288849,10.16223526,0.887020171,65.09999847,0.714466453,-0.070612296,0.823047519,0.645214975,0.189521536,Asia
146
+ Rwanda,2019,3.268152237,7.708060741,0.489458233,61.70000076,0.868999183,0.064065881,0.167970896,0.736067951,0.417667687,Africa
147
+ Saint Kitts and Nevis,,,,,,,,,,,North America
148
+ Saint Lucia,,,,,,,,,,,North America
149
+ Saint Vincent and the Grenadines,,,,,,,,,,,North America
150
+ Samoa,,,,,,,,,,,Oceania
151
+ San Marino,,,,,,,,,,,Europe
152
+ Sao Tome and Principe,,,,,,,,,,,Africa
153
+ Saudi Arabia,2020,6.559588432,10.70066261,0.890255928,66.90000153,0.884220123,-0.11053171,,0.753607631,0.251199067,Asia
154
+ Senegal,2019,5.488736629,8.130020142,0.687614083,60,0.758841753,-0.018803915,0.79567343,0.788973033,0.331925839,Africa
155
+ Serbia,2020,6.041546345,9.788259506,0.852101862,69,0.843479872,0.149401307,0.824472487,0.602846146,0.357580274,Europe
156
+ Seychelles,,,,,,,,,,,Africa
157
+ Sierra Leone,2019,3.447381496,7.449131966,0.610779762,52.40000153,0.717769563,0.074055701,0.873861432,0.513375223,0.438134462,Africa
158
+ Singapore,2019,6.378359795,11.48598003,0.924918354,77.09999847,0.938041747,0.027229678,0.069619603,0.722598016,0.138069153,Asia
159
+ Slovakia,2020,6.519098282,10.33151245,0.954159975,69.5,0.76189661,-0.074873514,0.900533676,0.763582885,0.274447888,Europe
160
+ Slovenia,2020,6.462076187,10.47786999,0.953437507,71.69999695,0.958442569,-0.08135689,0.796557486,0.609949231,0.313852519,Europe
161
+ Solomon Islands,,,,,,,,,,,Oceania
162
+ Somalia,2016,4.667941093,,0.594416559,50,0.917322814,,0.44080174,0.891423166,0.193282232,Africa
163
+ South Africa,2020,4.946800709,9.332463264,0.891050339,57.29999924,0.756946266,-0.014951312,0.912407219,0.820337772,0.294276476,Africa
164
+ South Korea,2020,5.792695522,10.64807415,0.807952285,74.19999695,0.711480439,-0.105867893,0.664694011,0.639555693,0.247059658,Asia
165
+ South Sudan,2017,2.816622496,,0.556822658,51,0.456011087,,0.761269629,0.585602164,0.517363787,Africa
166
+ Spain,2020,6.502175331,10.48805904,0.934934676,75,0.783256531,-0.120613314,0.729977489,0.686177611,0.316617101,Europe
167
+ Sri Lanka,2019,4.213299274,9.478693962,0.814939141,67.40000153,0.824277341,0.051186614,0.863342285,0.816390395,0.314542711,Asia
168
+ Sudan,2014,4.138672829,8.3170681,0.81061554,55.11999893,0.3900958,-0.063394643,0.793785036,0.540845037,0.302724987,Africa
169
+ Suriname,2012,6.269286633,9.797084808,0.797262073,62.24000168,0.885488451,-0.077173166,0.751282871,0.764222682,0.250364989,South America
170
+ Swaziland,2019,4.396114826,9.069709778,0.759097695,51.27039337,0.596682429,-0.190737918,0.723507762,0.777627289,0.279595166,Africa
171
+ Sweden,2020,7.314341068,10.83790398,0.93558234,72.80000305,0.951181591,0.09081845,0.203440145,0.766376078,0.22193329,Europe
172
+ Switzerland,2020,7.508435249,11.08089256,0.946316481,74.69999695,0.917343259,-0.063502058,0.280367136,0.768704712,0.19322899,Europe
173
+ Syria,2015,3.46191287,8.441536903,0.463912874,55.20000076,0.448270857,0.044834916,0.685236931,0.369439602,0.642588735,Asia
174
+ Taiwan,2020,6.751067638,,0.900832534,,0.798834741,,0.710567415,0.84539336,0.082736954,Asia
175
+ Tajikistan,2020,5.373398781,8.080356598,0.789744556,64.69999695,,-0.040467065,0.549786448,0.748897612,0.344161272,Asia
176
+ Tanzania,2020,3.785684109,7.881270409,0.739817083,58.5,0.830343485,0.295271993,0.520631671,0.685533106,0.271117926,Africa
177
+ Thailand,2020,5.884544373,9.76924324,0.866702616,67.59999847,0.840463281,0.273055583,0.918340027,0.783269882,0.326168567,Asia
178
+ Togo,2019,4.179493904,7.375211239,0.53870219,55.09999847,0.617419779,0.064774826,0.736675024,0.590229273,0.443869889,Africa
179
+ Tonga,,,,,,,,,,,Oceania
180
+ Trinidad and Tobago,2017,6.191859722,10.18292046,0.916029036,63.5,0.859140456,0.014855396,0.911336362,0.846467078,0.248098806,North America
181
+ Tunisia,2020,4.730811119,9.230624199,0.719013214,67.5,0.667758107,-0.201814234,0.877354085,0.584633887,0.438774347,Africa
182
+ Turkey,2020,4.861554146,10.21908379,0.856730223,67.59999847,0.510385871,-0.110888988,0.774417162,0.384292454,0.440387309,Asia
183
+ Turkmenistan,2019,5.474299908,9.651184082,0.981501758,62.59999847,0.891526878,0.284880638,,0.509914517,0.183343247,Asia
184
+ Tuvalu,,,,,,,,,,,Oceania
185
+ Uganda,2020,4.640909672,7.68445015,0.800461173,56.5,0.687482119,0.147117555,0.877587259,0.69894886,0.424706668,Africa
186
+ Ukraine,2020,5.269675732,9.427873611,0.884686291,65.19999695,0.784273446,0.126344204,0.945668995,0.687720656,0.284736186,Europe
187
+ United Arab Emirates,2020,6.458392143,11.05288982,0.826755583,67.5,0.9421615,0.060019661,,0.75165993,0.298480302,Asia
188
+ United Kingdom,2020,6.798177242,10.62581062,0.929353237,72.69999695,0.884624004,0.20250842,0.490203947,0.758163571,0.224655122,Europe
189
+ United States,2020,7.028088093,11.00065613,0.937369823,68.09999847,0.850447297,0.034103353,0.678124607,0.787371993,0.295499027,North America
190
+ Uruguay,2020,6.309681416,9.937191963,0.921070337,69.19999695,0.907761931,-0.083986901,0.491007835,0.807350934,0.264692068,South America
191
+ Uzbekistan,2019,6.154049397,8.853480339,0.915275931,65.40000153,0.970294535,0.304297596,0.511196852,0.844808519,0.219745517,Asia
192
+ Vanuatu,,,,,,,,,,,Oceania
193
+ Vatican City,,,,,,,,,,,Europe
194
+ Venezuela,2020,4.573829651,,0.80522424,66.90000153,0.611814618,,0.811319113,0.722391427,0.396250457,South America
195
+ Vietnam,2019,5.467451096,8.992330551,0.847592115,68.09999847,0.95246917,-0.125530764,0.787889242,0.751159906,0.18561019,Asia
196
+ Yemen,2019,4.196912766,,0.870042801,57.5,0.651308239,,0.798228264,0.54280591,0.213043228,Asia
197
+ Zambia,2020,4.837992191,8.116580009,0.766871631,56.29999924,0.750422418,0.056029193,0.809749782,0.691082239,0.344525933,Africa
198
+ Zimbabwe,2020,3.159802198,7.828756809,0.717242658,56.79999924,0.643302977,-0.008695764,0.78852278,0.702572763,0.345736384,Africa
Assets/Countries/countries.csv ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Country,Continent
2
+ Algeria,Africa
3
+ Angola,Africa
4
+ Benin,Africa
5
+ Botswana,Africa
6
+ Burkina,Africa
7
+ Burundi,Africa
8
+ Cameroon,Africa
9
+ Cape Verde,Africa
10
+ Central African Republic,Africa
11
+ Chad,Africa
12
+ Comoros,Africa
13
+ Congo,Africa
14
+ "Congo, Democratic Republic of",Africa
15
+ Djibouti,Africa
16
+ Egypt,Africa
17
+ Equatorial Guinea,Africa
18
+ Eritrea,Africa
19
+ Ethiopia,Africa
20
+ Gabon,Africa
21
+ Gambia,Africa
22
+ Ghana,Africa
23
+ Guinea,Africa
24
+ Guinea-Bissau,Africa
25
+ Ivory Coast,Africa
26
+ Kenya,Africa
27
+ Lesotho,Africa
28
+ Liberia,Africa
29
+ Libya,Africa
30
+ Madagascar,Africa
31
+ Malawi,Africa
32
+ Mali,Africa
33
+ Mauritania,Africa
34
+ Mauritius,Africa
35
+ Morocco,Africa
36
+ Mozambique,Africa
37
+ Namibia,Africa
38
+ Niger,Africa
39
+ Nigeria,Africa
40
+ Rwanda,Africa
41
+ Sao Tome and Principe,Africa
42
+ Senegal,Africa
43
+ Seychelles,Africa
44
+ Sierra Leone,Africa
45
+ Somalia,Africa
46
+ South Africa,Africa
47
+ South Sudan,Africa
48
+ Sudan,Africa
49
+ Swaziland,Africa
50
+ Tanzania,Africa
51
+ Togo,Africa
52
+ Tunisia,Africa
53
+ Uganda,Africa
54
+ Zambia,Africa
55
+ Zimbabwe,Africa
56
+ Afghanistan,Asia
57
+ Bahrain,Asia
58
+ Bangladesh,Asia
59
+ Bhutan,Asia
60
+ Brunei,Asia
61
+ Burma (Myanmar),Asia
62
+ Cambodia,Asia
63
+ China,Asia
64
+ East Timor,Asia
65
+ India,Asia
66
+ Indonesia,Asia
67
+ Iran,Asia
68
+ Iraq,Asia
69
+ Israel,Asia
70
+ Japan,Asia
71
+ Jordan,Asia
72
+ Kazakhstan,Asia
73
+ "Korea, North",Asia
74
+ "Korea, South",Asia
75
+ Kuwait,Asia
76
+ Kyrgyzstan,Asia
77
+ Laos,Asia
78
+ Lebanon,Asia
79
+ Malaysia,Asia
80
+ Maldives,Asia
81
+ Mongolia,Asia
82
+ Nepal,Asia
83
+ Oman,Asia
84
+ Pakistan,Asia
85
+ Philippines,Asia
86
+ Qatar,Asia
87
+ Russian Federation,Asia
88
+ Saudi Arabia,Asia
89
+ Singapore,Asia
90
+ Sri Lanka,Asia
91
+ Syria,Asia
92
+ Tajikistan,Asia
93
+ Thailand,Asia
94
+ Turkey,Asia
95
+ Turkmenistan,Asia
96
+ United Arab Emirates,Asia
97
+ Uzbekistan,Asia
98
+ Vietnam,Asia
99
+ Yemen,Asia
100
+ Albania,Europe
101
+ Andorra,Europe
102
+ Armenia,Europe
103
+ Austria,Europe
104
+ Azerbaijan,Europe
105
+ Belarus,Europe
106
+ Belgium,Europe
107
+ Bosnia and Herzegovina,Europe
108
+ Bulgaria,Europe
109
+ Croatia,Europe
110
+ Cyprus,Europe
111
+ CZ,Europe
112
+ Denmark,Europe
113
+ Estonia,Europe
114
+ Finland,Europe
115
+ France,Europe
116
+ Georgia,Europe
117
+ Germany,Europe
118
+ Greece,Europe
119
+ Hungary,Europe
120
+ Iceland,Europe
121
+ Ireland,Europe
122
+ Italy,Europe
123
+ Latvia,Europe
124
+ Liechtenstein,Europe
125
+ Lithuania,Europe
126
+ Luxembourg,Europe
127
+ Macedonia,Europe
128
+ Malta,Europe
129
+ Moldova,Europe
130
+ Monaco,Europe
131
+ Montenegro,Europe
132
+ Netherlands,Europe
133
+ Norway,Europe
134
+ Poland,Europe
135
+ Portugal,Europe
136
+ Romania,Europe
137
+ San Marino,Europe
138
+ Serbia,Europe
139
+ Slovakia,Europe
140
+ Slovenia,Europe
141
+ Spain,Europe
142
+ Sweden,Europe
143
+ Switzerland,Europe
144
+ Ukraine,Europe
145
+ United Kingdom,Europe
146
+ Vatican City,Europe
147
+ Antigua and Barbuda,North America
148
+ Bahamas,North America
149
+ Barbados,North America
150
+ Belize,North America
151
+ Canada,North America
152
+ Costa Rica,North America
153
+ Cuba,North America
154
+ Dominica,North America
155
+ Dominican Republic,North America
156
+ El Salvador,North America
157
+ Grenada,North America
158
+ Guatemala,North America
159
+ Haiti,North America
160
+ Honduras,North America
161
+ Jamaica,North America
162
+ Mexico,North America
163
+ Nicaragua,North America
164
+ Panama,North America
165
+ Saint Kitts and Nevis,North America
166
+ Saint Lucia,North America
167
+ Saint Vincent and the Grenadines,North America
168
+ Trinidad and Tobago,North America
169
+ US,North America
170
+ Australia,Oceania
171
+ Fiji,Oceania
172
+ Kiribati,Oceania
173
+ Marshall Islands,Oceania
174
+ Micronesia,Oceania
175
+ Nauru,Oceania
176
+ New Zealand,Oceania
177
+ Palau,Oceania
178
+ Papua New Guinea,Oceania
179
+ Samoa,Oceania
180
+ Solomon Islands,Oceania
181
+ Tonga,Oceania
182
+ Tuvalu,Oceania
183
+ Vanuatu,Oceania
184
+ Argentina,South America
185
+ Bolivia,South America
186
+ Brazil,South America
187
+ Chile,South America
188
+ Colombia,South America
189
+ Ecuador,South America
190
+ Guyana,South America
191
+ Paraguay,South America
192
+ Peru,South America
193
+ Suriname,South America
194
+ Uruguay,South America
195
+ Venezuela,South America
Assets/Professions/.ipynb_checkpoints/Standard_Occupational_Classifications_Orgin-checkpoint.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Where did this data come from?
2
+
3
+ In looking for a solid list, I determined that the US Bureau of Labor Statistics would provide an excellent starting point for comprehensive listings of titles. This data can be found at [Standard Occupational Classifications in 2018](https://www.bls.gov/soc/2018/home.htm). Specifically, I made use of their [Direct Match Title File](https://www.bls.gov/soc/2018/home.htm#match), because it seemed to have the most comprehensive list and provided SOC categories.
4
+
5
+ Here's the Header from the file:
6
+ > U.S. Bureau of Labor Statistics
7
+ > On behalf of the Office of Management and Budget (OMB) and the Standard Occupational Classification Policy Committee (SOCPC)
8
+ > November 2017 (Updated April 15, 2020)
9
+ > ***Questions should be emailed to soc@bls.gov***
Assets/Professions/.ipynb_checkpoints/clean-SOC-2018-checkpoint.ipynb ADDED
@@ -0,0 +1,558 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "08cf1c6f-0895-4e7b-9279-109c55dd6596",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import pandas as pd, spacy, nltk, numpy as np, re, ssl"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 52,
16
+ "id": "e3a83c6d-bfb4-4aa2-a9dd-a4fd7ffe6d03",
17
+ "metadata": {},
18
+ "outputs": [],
19
+ "source": [
20
+ "df = pd.read_csv(\"soc_2018_direct_match_title_file.csv\")"
21
+ ]
22
+ },
23
+ {
24
+ "cell_type": "code",
25
+ "execution_count": 53,
26
+ "id": "afa91f8f-d7f6-47a0-adc3-b21866acc2fa",
27
+ "metadata": {},
28
+ "outputs": [
29
+ {
30
+ "data": {
31
+ "text/html": [
32
+ "<div>\n",
33
+ "<style scoped>\n",
34
+ " .dataframe tbody tr th:only-of-type {\n",
35
+ " vertical-align: middle;\n",
36
+ " }\n",
37
+ "\n",
38
+ " .dataframe tbody tr th {\n",
39
+ " vertical-align: top;\n",
40
+ " }\n",
41
+ "\n",
42
+ " .dataframe thead th {\n",
43
+ " text-align: right;\n",
44
+ " }\n",
45
+ "</style>\n",
46
+ "<table border=\"1\" class=\"dataframe\">\n",
47
+ " <thead>\n",
48
+ " <tr style=\"text-align: right;\">\n",
49
+ " <th></th>\n",
50
+ " <th>2018 SOC Code</th>\n",
51
+ " <th>2018 SOC Title</th>\n",
52
+ " <th>2018 SOC Direct Match Title</th>\n",
53
+ " <th>Illustrative Example</th>\n",
54
+ " </tr>\n",
55
+ " </thead>\n",
56
+ " <tbody>\n",
57
+ " <tr>\n",
58
+ " <th>0</th>\n",
59
+ " <td>11-1011</td>\n",
60
+ " <td>Chief Executives</td>\n",
61
+ " <td>Admiral</td>\n",
62
+ " <td>x</td>\n",
63
+ " </tr>\n",
64
+ " <tr>\n",
65
+ " <th>1</th>\n",
66
+ " <td>11-1011</td>\n",
67
+ " <td>Chief Executives</td>\n",
68
+ " <td>CEO</td>\n",
69
+ " <td>NaN</td>\n",
70
+ " </tr>\n",
71
+ " <tr>\n",
72
+ " <th>2</th>\n",
73
+ " <td>11-1011</td>\n",
74
+ " <td>Chief Executives</td>\n",
75
+ " <td>Chief Executive Officer</td>\n",
76
+ " <td>NaN</td>\n",
77
+ " </tr>\n",
78
+ " <tr>\n",
79
+ " <th>3</th>\n",
80
+ " <td>11-1011</td>\n",
81
+ " <td>Chief Executives</td>\n",
82
+ " <td>Chief Financial Officer</td>\n",
83
+ " <td>x</td>\n",
84
+ " </tr>\n",
85
+ " <tr>\n",
86
+ " <th>4</th>\n",
87
+ " <td>11-1011</td>\n",
88
+ " <td>Chief Executives</td>\n",
89
+ " <td>Chief Operating Officer</td>\n",
90
+ " <td>x</td>\n",
91
+ " </tr>\n",
92
+ " </tbody>\n",
93
+ "</table>\n",
94
+ "</div>"
95
+ ],
96
+ "text/plain": [
97
+ " 2018 SOC Code 2018 SOC Title 2018 SOC Direct Match Title \\\n",
98
+ "0 11-1011 Chief Executives Admiral \n",
99
+ "1 11-1011 Chief Executives CEO \n",
100
+ "2 11-1011 Chief Executives Chief Executive Officer \n",
101
+ "3 11-1011 Chief Executives Chief Financial Officer \n",
102
+ "4 11-1011 Chief Executives Chief Operating Officer \n",
103
+ "\n",
104
+ " Illustrative Example \n",
105
+ "0 x \n",
106
+ "1 NaN \n",
107
+ "2 NaN \n",
108
+ "3 x \n",
109
+ "4 x "
110
+ ]
111
+ },
112
+ "execution_count": 53,
113
+ "metadata": {},
114
+ "output_type": "execute_result"
115
+ }
116
+ ],
117
+ "source": [
118
+ "df.head()"
119
+ ]
120
+ },
121
+ {
122
+ "cell_type": "code",
123
+ "execution_count": 54,
124
+ "id": "c2cc8198-f1ba-4318-b4f0-ae2d525290ff",
125
+ "metadata": {},
126
+ "outputs": [],
127
+ "source": [
128
+ "df = df.drop(\"Illustrative Example\", axis=1)"
129
+ ]
130
+ },
131
+ {
132
+ "cell_type": "code",
133
+ "execution_count": 55,
134
+ "id": "020c3356-8263-47af-b6e3-bf6d27bfee78",
135
+ "metadata": {},
136
+ "outputs": [
137
+ {
138
+ "data": {
139
+ "text/html": [
140
+ "<div>\n",
141
+ "<style scoped>\n",
142
+ " .dataframe tbody tr th:only-of-type {\n",
143
+ " vertical-align: middle;\n",
144
+ " }\n",
145
+ "\n",
146
+ " .dataframe tbody tr th {\n",
147
+ " vertical-align: top;\n",
148
+ " }\n",
149
+ "\n",
150
+ " .dataframe thead th {\n",
151
+ " text-align: right;\n",
152
+ " }\n",
153
+ "</style>\n",
154
+ "<table border=\"1\" class=\"dataframe\">\n",
155
+ " <thead>\n",
156
+ " <tr style=\"text-align: right;\">\n",
157
+ " <th></th>\n",
158
+ " <th>2018 SOC Code</th>\n",
159
+ " <th>2018 SOC Title</th>\n",
160
+ " <th>2018 SOC Direct Match Title</th>\n",
161
+ " </tr>\n",
162
+ " </thead>\n",
163
+ " <tbody>\n",
164
+ " <tr>\n",
165
+ " <th>0</th>\n",
166
+ " <td>11-1011</td>\n",
167
+ " <td>Chief Executives</td>\n",
168
+ " <td>Admiral</td>\n",
169
+ " </tr>\n",
170
+ " <tr>\n",
171
+ " <th>1</th>\n",
172
+ " <td>11-1011</td>\n",
173
+ " <td>Chief Executives</td>\n",
174
+ " <td>CEO</td>\n",
175
+ " </tr>\n",
176
+ " <tr>\n",
177
+ " <th>2</th>\n",
178
+ " <td>11-1011</td>\n",
179
+ " <td>Chief Executives</td>\n",
180
+ " <td>Chief Executive Officer</td>\n",
181
+ " </tr>\n",
182
+ " <tr>\n",
183
+ " <th>3</th>\n",
184
+ " <td>11-1011</td>\n",
185
+ " <td>Chief Executives</td>\n",
186
+ " <td>Chief Financial Officer</td>\n",
187
+ " </tr>\n",
188
+ " <tr>\n",
189
+ " <th>4</th>\n",
190
+ " <td>11-1011</td>\n",
191
+ " <td>Chief Executives</td>\n",
192
+ " <td>Chief Operating Officer</td>\n",
193
+ " </tr>\n",
194
+ " </tbody>\n",
195
+ "</table>\n",
196
+ "</div>"
197
+ ],
198
+ "text/plain": [
199
+ " 2018 SOC Code 2018 SOC Title 2018 SOC Direct Match Title\n",
200
+ "0 11-1011 Chief Executives Admiral\n",
201
+ "1 11-1011 Chief Executives CEO\n",
202
+ "2 11-1011 Chief Executives Chief Executive Officer\n",
203
+ "3 11-1011 Chief Executives Chief Financial Officer\n",
204
+ "4 11-1011 Chief Executives Chief Operating Officer"
205
+ ]
206
+ },
207
+ "execution_count": 55,
208
+ "metadata": {},
209
+ "output_type": "execute_result"
210
+ }
211
+ ],
212
+ "source": [
213
+ "df.head()"
214
+ ]
215
+ },
216
+ {
217
+ "cell_type": "code",
218
+ "execution_count": 56,
219
+ "id": "538a8047-9de8-4d29-961c-6b008c298e67",
220
+ "metadata": {},
221
+ "outputs": [],
222
+ "source": [
223
+ "df[\"Major\"] = df[\"2018 SOC Code\"].apply(lambda x: x[:2]).apply(int)"
224
+ ]
225
+ },
226
+ {
227
+ "cell_type": "code",
228
+ "execution_count": 57,
229
+ "id": "5969d5bc-69a5-42f6-a774-73a28e85b019",
230
+ "metadata": {},
231
+ "outputs": [],
232
+ "source": [
233
+ "# https://www.bls.gov/soc/2018/soc_2018_class_and_coding_structure.pdf determines the categorization.\n",
234
+ "def high_level_agg(number):\n",
235
+ " if 11 <= number <= 29:\n",
236
+ " category = \"Management, Business, Science, and Arts Occupations\"\n",
237
+ " elif 31 <= number <= 39:\n",
238
+ " category = \"Service Occupations\"\n",
239
+ " elif 41 <= number <= 43:\n",
240
+ " category = \"Sales and Office Occupations\"\n",
241
+ " elif 45 <= number <= 49:\n",
242
+ " category = \"Natural Resources, Construction, and Maintenance Occupations\"\n",
243
+ " elif 51 <= number <= 53:\n",
244
+ " category = \"Production, Transportation, and Material Moving Occupations\"\n",
245
+ " else:\n",
246
+ " category = \"Military Specific Occupations\"\n",
247
+ " return category"
248
+ ]
249
+ },
250
+ {
251
+ "cell_type": "code",
252
+ "execution_count": 58,
253
+ "id": "ebd35a6d-e0cd-497f-9c0b-9acf24de25dc",
254
+ "metadata": {},
255
+ "outputs": [
256
+ {
257
+ "data": {
258
+ "text/plain": [
259
+ "array([11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43,\n",
260
+ " 45, 47, 49, 51, 53, 55])"
261
+ ]
262
+ },
263
+ "execution_count": 58,
264
+ "metadata": {},
265
+ "output_type": "execute_result"
266
+ }
267
+ ],
268
+ "source": [
269
+ "df.Major.unique()"
270
+ ]
271
+ },
272
+ {
273
+ "cell_type": "code",
274
+ "execution_count": 59,
275
+ "id": "729a6707-e442-4ad4-ad50-c6f701e00757",
276
+ "metadata": {},
277
+ "outputs": [],
278
+ "source": [
279
+ "df[\"high_level\"] = df.Major.apply(high_level_agg)"
280
+ ]
281
+ },
282
+ {
283
+ "cell_type": "code",
284
+ "execution_count": 60,
285
+ "id": "8017e2e0-5635-47fc-bef6-be13e6988177",
286
+ "metadata": {},
287
+ "outputs": [
288
+ {
289
+ "data": {
290
+ "text/html": [
291
+ "<div>\n",
292
+ "<style scoped>\n",
293
+ " .dataframe tbody tr th:only-of-type {\n",
294
+ " vertical-align: middle;\n",
295
+ " }\n",
296
+ "\n",
297
+ " .dataframe tbody tr th {\n",
298
+ " vertical-align: top;\n",
299
+ " }\n",
300
+ "\n",
301
+ " .dataframe thead th {\n",
302
+ " text-align: right;\n",
303
+ " }\n",
304
+ "</style>\n",
305
+ "<table border=\"1\" class=\"dataframe\">\n",
306
+ " <thead>\n",
307
+ " <tr style=\"text-align: right;\">\n",
308
+ " <th></th>\n",
309
+ " <th>2018 SOC Code</th>\n",
310
+ " <th>2018 SOC Title</th>\n",
311
+ " <th>2018 SOC Direct Match Title</th>\n",
312
+ " <th>Major</th>\n",
313
+ " <th>high_level</th>\n",
314
+ " </tr>\n",
315
+ " </thead>\n",
316
+ " <tbody>\n",
317
+ " <tr>\n",
318
+ " <th>0</th>\n",
319
+ " <td>11-1011</td>\n",
320
+ " <td>Chief Executives</td>\n",
321
+ " <td>Admiral</td>\n",
322
+ " <td>11</td>\n",
323
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
324
+ " </tr>\n",
325
+ " <tr>\n",
326
+ " <th>1</th>\n",
327
+ " <td>11-1011</td>\n",
328
+ " <td>Chief Executives</td>\n",
329
+ " <td>CEO</td>\n",
330
+ " <td>11</td>\n",
331
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
332
+ " </tr>\n",
333
+ " <tr>\n",
334
+ " <th>2</th>\n",
335
+ " <td>11-1011</td>\n",
336
+ " <td>Chief Executives</td>\n",
337
+ " <td>Chief Executive Officer</td>\n",
338
+ " <td>11</td>\n",
339
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
340
+ " </tr>\n",
341
+ " <tr>\n",
342
+ " <th>3</th>\n",
343
+ " <td>11-1011</td>\n",
344
+ " <td>Chief Executives</td>\n",
345
+ " <td>Chief Financial Officer</td>\n",
346
+ " <td>11</td>\n",
347
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
348
+ " </tr>\n",
349
+ " <tr>\n",
350
+ " <th>4</th>\n",
351
+ " <td>11-1011</td>\n",
352
+ " <td>Chief Executives</td>\n",
353
+ " <td>Chief Operating Officer</td>\n",
354
+ " <td>11</td>\n",
355
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
356
+ " </tr>\n",
357
+ " </tbody>\n",
358
+ "</table>\n",
359
+ "</div>"
360
+ ],
361
+ "text/plain": [
362
+ " 2018 SOC Code 2018 SOC Title 2018 SOC Direct Match Title Major \\\n",
363
+ "0 11-1011 Chief Executives Admiral 11 \n",
364
+ "1 11-1011 Chief Executives CEO 11 \n",
365
+ "2 11-1011 Chief Executives Chief Executive Officer 11 \n",
366
+ "3 11-1011 Chief Executives Chief Financial Officer 11 \n",
367
+ "4 11-1011 Chief Executives Chief Operating Officer 11 \n",
368
+ "\n",
369
+ " high_level \n",
370
+ "0 Management, Business, Science, and Arts Occupa... \n",
371
+ "1 Management, Business, Science, and Arts Occupa... \n",
372
+ "2 Management, Business, Science, and Arts Occupa... \n",
373
+ "3 Management, Business, Science, and Arts Occupa... \n",
374
+ "4 Management, Business, Science, and Arts Occupa... "
375
+ ]
376
+ },
377
+ "execution_count": 60,
378
+ "metadata": {},
379
+ "output_type": "execute_result"
380
+ }
381
+ ],
382
+ "source": [
383
+ "df.head()"
384
+ ]
385
+ },
386
+ {
387
+ "cell_type": "code",
388
+ "execution_count": 61,
389
+ "id": "885a1379-3795-4e52-a6a6-b1f03476101e",
390
+ "metadata": {},
391
+ "outputs": [],
392
+ "source": [
393
+ "names = {\"2018 SOC Code\":\"SOC_code\", \"2018 SOC Title\": \"Category\", \"2018 SOC Direct Match Title\":\"Words\"}"
394
+ ]
395
+ },
396
+ {
397
+ "cell_type": "code",
398
+ "execution_count": 62,
399
+ "id": "b77202c7-8e4a-4bed-bc89-e7f146e857ba",
400
+ "metadata": {},
401
+ "outputs": [],
402
+ "source": [
403
+ "df = df.rename(columns=names)"
404
+ ]
405
+ },
406
+ {
407
+ "cell_type": "code",
408
+ "execution_count": 63,
409
+ "id": "7035d6dc-0638-4069-8a17-074b7bab5366",
410
+ "metadata": {},
411
+ "outputs": [
412
+ {
413
+ "data": {
414
+ "text/html": [
415
+ "<div>\n",
416
+ "<style scoped>\n",
417
+ " .dataframe tbody tr th:only-of-type {\n",
418
+ " vertical-align: middle;\n",
419
+ " }\n",
420
+ "\n",
421
+ " .dataframe tbody tr th {\n",
422
+ " vertical-align: top;\n",
423
+ " }\n",
424
+ "\n",
425
+ " .dataframe thead th {\n",
426
+ " text-align: right;\n",
427
+ " }\n",
428
+ "</style>\n",
429
+ "<table border=\"1\" class=\"dataframe\">\n",
430
+ " <thead>\n",
431
+ " <tr style=\"text-align: right;\">\n",
432
+ " <th></th>\n",
433
+ " <th>SOC_code</th>\n",
434
+ " <th>Category</th>\n",
435
+ " <th>Words</th>\n",
436
+ " <th>Major</th>\n",
437
+ " <th>high_level</th>\n",
438
+ " </tr>\n",
439
+ " </thead>\n",
440
+ " <tbody>\n",
441
+ " <tr>\n",
442
+ " <th>0</th>\n",
443
+ " <td>11-1011</td>\n",
444
+ " <td>Chief Executives</td>\n",
445
+ " <td>Admiral</td>\n",
446
+ " <td>11</td>\n",
447
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
448
+ " </tr>\n",
449
+ " <tr>\n",
450
+ " <th>1</th>\n",
451
+ " <td>11-1011</td>\n",
452
+ " <td>Chief Executives</td>\n",
453
+ " <td>CEO</td>\n",
454
+ " <td>11</td>\n",
455
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
456
+ " </tr>\n",
457
+ " <tr>\n",
458
+ " <th>2</th>\n",
459
+ " <td>11-1011</td>\n",
460
+ " <td>Chief Executives</td>\n",
461
+ " <td>Chief Executive Officer</td>\n",
462
+ " <td>11</td>\n",
463
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
464
+ " </tr>\n",
465
+ " <tr>\n",
466
+ " <th>3</th>\n",
467
+ " <td>11-1011</td>\n",
468
+ " <td>Chief Executives</td>\n",
469
+ " <td>Chief Financial Officer</td>\n",
470
+ " <td>11</td>\n",
471
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
472
+ " </tr>\n",
473
+ " <tr>\n",
474
+ " <th>4</th>\n",
475
+ " <td>11-1011</td>\n",
476
+ " <td>Chief Executives</td>\n",
477
+ " <td>Chief Operating Officer</td>\n",
478
+ " <td>11</td>\n",
479
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
480
+ " </tr>\n",
481
+ " </tbody>\n",
482
+ "</table>\n",
483
+ "</div>"
484
+ ],
485
+ "text/plain": [
486
+ " SOC_code Category Words Major \\\n",
487
+ "0 11-1011 Chief Executives Admiral 11 \n",
488
+ "1 11-1011 Chief Executives CEO 11 \n",
489
+ "2 11-1011 Chief Executives Chief Executive Officer 11 \n",
490
+ "3 11-1011 Chief Executives Chief Financial Officer 11 \n",
491
+ "4 11-1011 Chief Executives Chief Operating Officer 11 \n",
492
+ "\n",
493
+ " high_level \n",
494
+ "0 Management, Business, Science, and Arts Occupa... \n",
495
+ "1 Management, Business, Science, and Arts Occupa... \n",
496
+ "2 Management, Business, Science, and Arts Occupa... \n",
497
+ "3 Management, Business, Science, and Arts Occupa... \n",
498
+ "4 Management, Business, Science, and Arts Occupa... "
499
+ ]
500
+ },
501
+ "execution_count": 63,
502
+ "metadata": {},
503
+ "output_type": "execute_result"
504
+ }
505
+ ],
506
+ "source": [
507
+ "df.head()"
508
+ ]
509
+ },
510
+ {
511
+ "cell_type": "code",
512
+ "execution_count": 64,
513
+ "id": "3f8c4a84-a50e-4dfe-9448-ac69c00750f4",
514
+ "metadata": {},
515
+ "outputs": [],
516
+ "source": [
517
+ "df.to_csv(\"soc-professions-2018.csv\")"
518
+ ]
519
+ },
520
+ {
521
+ "cell_type": "code",
522
+ "execution_count": null,
523
+ "id": "753cbdaf-41a5-4665-b13f-145702b293ec",
524
+ "metadata": {},
525
+ "outputs": [],
526
+ "source": []
527
+ },
528
+ {
529
+ "cell_type": "code",
530
+ "execution_count": null,
531
+ "id": "b44845e3-5a9f-4009-894c-a8e7b43b4d1b",
532
+ "metadata": {},
533
+ "outputs": [],
534
+ "source": []
535
+ }
536
+ ],
537
+ "metadata": {
538
+ "kernelspec": {
539
+ "display_name": "Python 3 (ipykernel)",
540
+ "language": "python",
541
+ "name": "python3"
542
+ },
543
+ "language_info": {
544
+ "codemirror_mode": {
545
+ "name": "ipython",
546
+ "version": 3
547
+ },
548
+ "file_extension": ".py",
549
+ "mimetype": "text/x-python",
550
+ "name": "python",
551
+ "nbconvert_exporter": "python",
552
+ "pygments_lexer": "ipython3",
553
+ "version": "3.8.8"
554
+ }
555
+ },
556
+ "nbformat": 4,
557
+ "nbformat_minor": 5
558
+ }
Assets/Professions/.ipynb_checkpoints/soc-professions-2018-checkpoint.csv ADDED
The diff for this file is too large to render. See raw diff
 
Assets/Professions/.ipynb_checkpoints/soc_2018_direct_match_title_file-checkpoint.csv ADDED
The diff for this file is too large to render. See raw diff
 
Assets/Professions/Standard_Occupational_Classifications_Orgin.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Where did this data come from?
2
+
3
+ In looking for a solid list, I determined that the US Bureau of Labor Statistics would provide an excellent starting point for comprehensive listings of titles. This data can be found at [Standard Occupational Classifications in 2018](https://www.bls.gov/soc/2018/home.htm). Specifically, I made use of their [Direct Match Title File](https://www.bls.gov/soc/2018/home.htm#match), because it seemed to have the most comprehensive list and provided SOC categories.
4
+
5
+ Here's the Header from the file:
6
+ > U.S. Bureau of Labor Statistics
7
+ > On behalf of the Office of Management and Budget (OMB) and the Standard Occupational Classification Policy Committee (SOCPC)
8
+ > November 2017 (Updated April 15, 2020)
9
+ > ***Questions should be emailed to soc@bls.gov***
Assets/Professions/clean-SOC-2018.ipynb ADDED
@@ -0,0 +1,558 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "08cf1c6f-0895-4e7b-9279-109c55dd6596",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import pandas as pd, spacy, nltk, numpy as np, re, ssl"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 52,
16
+ "id": "e3a83c6d-bfb4-4aa2-a9dd-a4fd7ffe6d03",
17
+ "metadata": {},
18
+ "outputs": [],
19
+ "source": [
20
+ "df = pd.read_csv(\"soc_2018_direct_match_title_file.csv\")"
21
+ ]
22
+ },
23
+ {
24
+ "cell_type": "code",
25
+ "execution_count": 53,
26
+ "id": "afa91f8f-d7f6-47a0-adc3-b21866acc2fa",
27
+ "metadata": {},
28
+ "outputs": [
29
+ {
30
+ "data": {
31
+ "text/html": [
32
+ "<div>\n",
33
+ "<style scoped>\n",
34
+ " .dataframe tbody tr th:only-of-type {\n",
35
+ " vertical-align: middle;\n",
36
+ " }\n",
37
+ "\n",
38
+ " .dataframe tbody tr th {\n",
39
+ " vertical-align: top;\n",
40
+ " }\n",
41
+ "\n",
42
+ " .dataframe thead th {\n",
43
+ " text-align: right;\n",
44
+ " }\n",
45
+ "</style>\n",
46
+ "<table border=\"1\" class=\"dataframe\">\n",
47
+ " <thead>\n",
48
+ " <tr style=\"text-align: right;\">\n",
49
+ " <th></th>\n",
50
+ " <th>2018 SOC Code</th>\n",
51
+ " <th>2018 SOC Title</th>\n",
52
+ " <th>2018 SOC Direct Match Title</th>\n",
53
+ " <th>Illustrative Example</th>\n",
54
+ " </tr>\n",
55
+ " </thead>\n",
56
+ " <tbody>\n",
57
+ " <tr>\n",
58
+ " <th>0</th>\n",
59
+ " <td>11-1011</td>\n",
60
+ " <td>Chief Executives</td>\n",
61
+ " <td>Admiral</td>\n",
62
+ " <td>x</td>\n",
63
+ " </tr>\n",
64
+ " <tr>\n",
65
+ " <th>1</th>\n",
66
+ " <td>11-1011</td>\n",
67
+ " <td>Chief Executives</td>\n",
68
+ " <td>CEO</td>\n",
69
+ " <td>NaN</td>\n",
70
+ " </tr>\n",
71
+ " <tr>\n",
72
+ " <th>2</th>\n",
73
+ " <td>11-1011</td>\n",
74
+ " <td>Chief Executives</td>\n",
75
+ " <td>Chief Executive Officer</td>\n",
76
+ " <td>NaN</td>\n",
77
+ " </tr>\n",
78
+ " <tr>\n",
79
+ " <th>3</th>\n",
80
+ " <td>11-1011</td>\n",
81
+ " <td>Chief Executives</td>\n",
82
+ " <td>Chief Financial Officer</td>\n",
83
+ " <td>x</td>\n",
84
+ " </tr>\n",
85
+ " <tr>\n",
86
+ " <th>4</th>\n",
87
+ " <td>11-1011</td>\n",
88
+ " <td>Chief Executives</td>\n",
89
+ " <td>Chief Operating Officer</td>\n",
90
+ " <td>x</td>\n",
91
+ " </tr>\n",
92
+ " </tbody>\n",
93
+ "</table>\n",
94
+ "</div>"
95
+ ],
96
+ "text/plain": [
97
+ " 2018 SOC Code 2018 SOC Title 2018 SOC Direct Match Title \\\n",
98
+ "0 11-1011 Chief Executives Admiral \n",
99
+ "1 11-1011 Chief Executives CEO \n",
100
+ "2 11-1011 Chief Executives Chief Executive Officer \n",
101
+ "3 11-1011 Chief Executives Chief Financial Officer \n",
102
+ "4 11-1011 Chief Executives Chief Operating Officer \n",
103
+ "\n",
104
+ " Illustrative Example \n",
105
+ "0 x \n",
106
+ "1 NaN \n",
107
+ "2 NaN \n",
108
+ "3 x \n",
109
+ "4 x "
110
+ ]
111
+ },
112
+ "execution_count": 53,
113
+ "metadata": {},
114
+ "output_type": "execute_result"
115
+ }
116
+ ],
117
+ "source": [
118
+ "df.head()"
119
+ ]
120
+ },
121
+ {
122
+ "cell_type": "code",
123
+ "execution_count": 54,
124
+ "id": "c2cc8198-f1ba-4318-b4f0-ae2d525290ff",
125
+ "metadata": {},
126
+ "outputs": [],
127
+ "source": [
128
+ "df = df.drop(\"Illustrative Example\", axis=1)"
129
+ ]
130
+ },
131
+ {
132
+ "cell_type": "code",
133
+ "execution_count": 55,
134
+ "id": "020c3356-8263-47af-b6e3-bf6d27bfee78",
135
+ "metadata": {},
136
+ "outputs": [
137
+ {
138
+ "data": {
139
+ "text/html": [
140
+ "<div>\n",
141
+ "<style scoped>\n",
142
+ " .dataframe tbody tr th:only-of-type {\n",
143
+ " vertical-align: middle;\n",
144
+ " }\n",
145
+ "\n",
146
+ " .dataframe tbody tr th {\n",
147
+ " vertical-align: top;\n",
148
+ " }\n",
149
+ "\n",
150
+ " .dataframe thead th {\n",
151
+ " text-align: right;\n",
152
+ " }\n",
153
+ "</style>\n",
154
+ "<table border=\"1\" class=\"dataframe\">\n",
155
+ " <thead>\n",
156
+ " <tr style=\"text-align: right;\">\n",
157
+ " <th></th>\n",
158
+ " <th>2018 SOC Code</th>\n",
159
+ " <th>2018 SOC Title</th>\n",
160
+ " <th>2018 SOC Direct Match Title</th>\n",
161
+ " </tr>\n",
162
+ " </thead>\n",
163
+ " <tbody>\n",
164
+ " <tr>\n",
165
+ " <th>0</th>\n",
166
+ " <td>11-1011</td>\n",
167
+ " <td>Chief Executives</td>\n",
168
+ " <td>Admiral</td>\n",
169
+ " </tr>\n",
170
+ " <tr>\n",
171
+ " <th>1</th>\n",
172
+ " <td>11-1011</td>\n",
173
+ " <td>Chief Executives</td>\n",
174
+ " <td>CEO</td>\n",
175
+ " </tr>\n",
176
+ " <tr>\n",
177
+ " <th>2</th>\n",
178
+ " <td>11-1011</td>\n",
179
+ " <td>Chief Executives</td>\n",
180
+ " <td>Chief Executive Officer</td>\n",
181
+ " </tr>\n",
182
+ " <tr>\n",
183
+ " <th>3</th>\n",
184
+ " <td>11-1011</td>\n",
185
+ " <td>Chief Executives</td>\n",
186
+ " <td>Chief Financial Officer</td>\n",
187
+ " </tr>\n",
188
+ " <tr>\n",
189
+ " <th>4</th>\n",
190
+ " <td>11-1011</td>\n",
191
+ " <td>Chief Executives</td>\n",
192
+ " <td>Chief Operating Officer</td>\n",
193
+ " </tr>\n",
194
+ " </tbody>\n",
195
+ "</table>\n",
196
+ "</div>"
197
+ ],
198
+ "text/plain": [
199
+ " 2018 SOC Code 2018 SOC Title 2018 SOC Direct Match Title\n",
200
+ "0 11-1011 Chief Executives Admiral\n",
201
+ "1 11-1011 Chief Executives CEO\n",
202
+ "2 11-1011 Chief Executives Chief Executive Officer\n",
203
+ "3 11-1011 Chief Executives Chief Financial Officer\n",
204
+ "4 11-1011 Chief Executives Chief Operating Officer"
205
+ ]
206
+ },
207
+ "execution_count": 55,
208
+ "metadata": {},
209
+ "output_type": "execute_result"
210
+ }
211
+ ],
212
+ "source": [
213
+ "df.head()"
214
+ ]
215
+ },
216
+ {
217
+ "cell_type": "code",
218
+ "execution_count": 56,
219
+ "id": "538a8047-9de8-4d29-961c-6b008c298e67",
220
+ "metadata": {},
221
+ "outputs": [],
222
+ "source": [
223
+ "df[\"Major\"] = df[\"2018 SOC Code\"].apply(lambda x: x[:2]).apply(int)"
224
+ ]
225
+ },
226
+ {
227
+ "cell_type": "code",
228
+ "execution_count": 1,
229
+ "id": "5969d5bc-69a5-42f6-a774-73a28e85b019",
230
+ "metadata": {},
231
+ "outputs": [],
232
+ "source": [
233
+ "# https://www.bls.gov/soc/2018/soc_2018_class_and_coding_structure.pdf determines the categorization.\n",
234
+ "def high_level_agg(number):\n",
235
+ " if 11 <= number <= 29:\n",
236
+ " category = \"Management, Business, Science, and Arts Occupations\"\n",
237
+ " elif 31 <= number <= 39:\n",
238
+ " category = \"Service Occupations\"\n",
239
+ " elif 41 <= number <= 43:\n",
240
+ " category = \"Sales and Office Occupations\"\n",
241
+ " elif 45 <= number <= 49:\n",
242
+ " category = \"Natural Resources, Construction, and Maintenance Occupations\"\n",
243
+ " elif 51 <= number <= 53:\n",
244
+ " category = \"Production, Transportation, and Material Moving Occupations\"\n",
245
+ " else:\n",
246
+ " category = \"Military Specific Occupations\"\n",
247
+ " return category"
248
+ ]
249
+ },
250
+ {
251
+ "cell_type": "code",
252
+ "execution_count": 58,
253
+ "id": "ebd35a6d-e0cd-497f-9c0b-9acf24de25dc",
254
+ "metadata": {},
255
+ "outputs": [
256
+ {
257
+ "data": {
258
+ "text/plain": [
259
+ "array([11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43,\n",
260
+ " 45, 47, 49, 51, 53, 55])"
261
+ ]
262
+ },
263
+ "execution_count": 58,
264
+ "metadata": {},
265
+ "output_type": "execute_result"
266
+ }
267
+ ],
268
+ "source": [
269
+ "df.Major.unique()"
270
+ ]
271
+ },
272
+ {
273
+ "cell_type": "code",
274
+ "execution_count": 59,
275
+ "id": "729a6707-e442-4ad4-ad50-c6f701e00757",
276
+ "metadata": {},
277
+ "outputs": [],
278
+ "source": [
279
+ "df[\"high_level\"] = df.Major.apply(high_level_agg)"
280
+ ]
281
+ },
282
+ {
283
+ "cell_type": "code",
284
+ "execution_count": 60,
285
+ "id": "8017e2e0-5635-47fc-bef6-be13e6988177",
286
+ "metadata": {},
287
+ "outputs": [
288
+ {
289
+ "data": {
290
+ "text/html": [
291
+ "<div>\n",
292
+ "<style scoped>\n",
293
+ " .dataframe tbody tr th:only-of-type {\n",
294
+ " vertical-align: middle;\n",
295
+ " }\n",
296
+ "\n",
297
+ " .dataframe tbody tr th {\n",
298
+ " vertical-align: top;\n",
299
+ " }\n",
300
+ "\n",
301
+ " .dataframe thead th {\n",
302
+ " text-align: right;\n",
303
+ " }\n",
304
+ "</style>\n",
305
+ "<table border=\"1\" class=\"dataframe\">\n",
306
+ " <thead>\n",
307
+ " <tr style=\"text-align: right;\">\n",
308
+ " <th></th>\n",
309
+ " <th>2018 SOC Code</th>\n",
310
+ " <th>2018 SOC Title</th>\n",
311
+ " <th>2018 SOC Direct Match Title</th>\n",
312
+ " <th>Major</th>\n",
313
+ " <th>high_level</th>\n",
314
+ " </tr>\n",
315
+ " </thead>\n",
316
+ " <tbody>\n",
317
+ " <tr>\n",
318
+ " <th>0</th>\n",
319
+ " <td>11-1011</td>\n",
320
+ " <td>Chief Executives</td>\n",
321
+ " <td>Admiral</td>\n",
322
+ " <td>11</td>\n",
323
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
324
+ " </tr>\n",
325
+ " <tr>\n",
326
+ " <th>1</th>\n",
327
+ " <td>11-1011</td>\n",
328
+ " <td>Chief Executives</td>\n",
329
+ " <td>CEO</td>\n",
330
+ " <td>11</td>\n",
331
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
332
+ " </tr>\n",
333
+ " <tr>\n",
334
+ " <th>2</th>\n",
335
+ " <td>11-1011</td>\n",
336
+ " <td>Chief Executives</td>\n",
337
+ " <td>Chief Executive Officer</td>\n",
338
+ " <td>11</td>\n",
339
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
340
+ " </tr>\n",
341
+ " <tr>\n",
342
+ " <th>3</th>\n",
343
+ " <td>11-1011</td>\n",
344
+ " <td>Chief Executives</td>\n",
345
+ " <td>Chief Financial Officer</td>\n",
346
+ " <td>11</td>\n",
347
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
348
+ " </tr>\n",
349
+ " <tr>\n",
350
+ " <th>4</th>\n",
351
+ " <td>11-1011</td>\n",
352
+ " <td>Chief Executives</td>\n",
353
+ " <td>Chief Operating Officer</td>\n",
354
+ " <td>11</td>\n",
355
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
356
+ " </tr>\n",
357
+ " </tbody>\n",
358
+ "</table>\n",
359
+ "</div>"
360
+ ],
361
+ "text/plain": [
362
+ " 2018 SOC Code 2018 SOC Title 2018 SOC Direct Match Title Major \\\n",
363
+ "0 11-1011 Chief Executives Admiral 11 \n",
364
+ "1 11-1011 Chief Executives CEO 11 \n",
365
+ "2 11-1011 Chief Executives Chief Executive Officer 11 \n",
366
+ "3 11-1011 Chief Executives Chief Financial Officer 11 \n",
367
+ "4 11-1011 Chief Executives Chief Operating Officer 11 \n",
368
+ "\n",
369
+ " high_level \n",
370
+ "0 Management, Business, Science, and Arts Occupa... \n",
371
+ "1 Management, Business, Science, and Arts Occupa... \n",
372
+ "2 Management, Business, Science, and Arts Occupa... \n",
373
+ "3 Management, Business, Science, and Arts Occupa... \n",
374
+ "4 Management, Business, Science, and Arts Occupa... "
375
+ ]
376
+ },
377
+ "execution_count": 60,
378
+ "metadata": {},
379
+ "output_type": "execute_result"
380
+ }
381
+ ],
382
+ "source": [
383
+ "df.head()"
384
+ ]
385
+ },
386
+ {
387
+ "cell_type": "code",
388
+ "execution_count": 61,
389
+ "id": "885a1379-3795-4e52-a6a6-b1f03476101e",
390
+ "metadata": {},
391
+ "outputs": [],
392
+ "source": [
393
+ "names = {\"2018 SOC Code\":\"SOC_code\", \"2018 SOC Title\": \"Category\", \"2018 SOC Direct Match Title\":\"Words\"}"
394
+ ]
395
+ },
396
+ {
397
+ "cell_type": "code",
398
+ "execution_count": 62,
399
+ "id": "b77202c7-8e4a-4bed-bc89-e7f146e857ba",
400
+ "metadata": {},
401
+ "outputs": [],
402
+ "source": [
403
+ "df = df.rename(columns=names)"
404
+ ]
405
+ },
406
+ {
407
+ "cell_type": "code",
408
+ "execution_count": 63,
409
+ "id": "7035d6dc-0638-4069-8a17-074b7bab5366",
410
+ "metadata": {},
411
+ "outputs": [
412
+ {
413
+ "data": {
414
+ "text/html": [
415
+ "<div>\n",
416
+ "<style scoped>\n",
417
+ " .dataframe tbody tr th:only-of-type {\n",
418
+ " vertical-align: middle;\n",
419
+ " }\n",
420
+ "\n",
421
+ " .dataframe tbody tr th {\n",
422
+ " vertical-align: top;\n",
423
+ " }\n",
424
+ "\n",
425
+ " .dataframe thead th {\n",
426
+ " text-align: right;\n",
427
+ " }\n",
428
+ "</style>\n",
429
+ "<table border=\"1\" class=\"dataframe\">\n",
430
+ " <thead>\n",
431
+ " <tr style=\"text-align: right;\">\n",
432
+ " <th></th>\n",
433
+ " <th>SOC_code</th>\n",
434
+ " <th>Category</th>\n",
435
+ " <th>Words</th>\n",
436
+ " <th>Major</th>\n",
437
+ " <th>high_level</th>\n",
438
+ " </tr>\n",
439
+ " </thead>\n",
440
+ " <tbody>\n",
441
+ " <tr>\n",
442
+ " <th>0</th>\n",
443
+ " <td>11-1011</td>\n",
444
+ " <td>Chief Executives</td>\n",
445
+ " <td>Admiral</td>\n",
446
+ " <td>11</td>\n",
447
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
448
+ " </tr>\n",
449
+ " <tr>\n",
450
+ " <th>1</th>\n",
451
+ " <td>11-1011</td>\n",
452
+ " <td>Chief Executives</td>\n",
453
+ " <td>CEO</td>\n",
454
+ " <td>11</td>\n",
455
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
456
+ " </tr>\n",
457
+ " <tr>\n",
458
+ " <th>2</th>\n",
459
+ " <td>11-1011</td>\n",
460
+ " <td>Chief Executives</td>\n",
461
+ " <td>Chief Executive Officer</td>\n",
462
+ " <td>11</td>\n",
463
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
464
+ " </tr>\n",
465
+ " <tr>\n",
466
+ " <th>3</th>\n",
467
+ " <td>11-1011</td>\n",
468
+ " <td>Chief Executives</td>\n",
469
+ " <td>Chief Financial Officer</td>\n",
470
+ " <td>11</td>\n",
471
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
472
+ " </tr>\n",
473
+ " <tr>\n",
474
+ " <th>4</th>\n",
475
+ " <td>11-1011</td>\n",
476
+ " <td>Chief Executives</td>\n",
477
+ " <td>Chief Operating Officer</td>\n",
478
+ " <td>11</td>\n",
479
+ " <td>Management, Business, Science, and Arts Occupa...</td>\n",
480
+ " </tr>\n",
481
+ " </tbody>\n",
482
+ "</table>\n",
483
+ "</div>"
484
+ ],
485
+ "text/plain": [
486
+ " SOC_code Category Words Major \\\n",
487
+ "0 11-1011 Chief Executives Admiral 11 \n",
488
+ "1 11-1011 Chief Executives CEO 11 \n",
489
+ "2 11-1011 Chief Executives Chief Executive Officer 11 \n",
490
+ "3 11-1011 Chief Executives Chief Financial Officer 11 \n",
491
+ "4 11-1011 Chief Executives Chief Operating Officer 11 \n",
492
+ "\n",
493
+ " high_level \n",
494
+ "0 Management, Business, Science, and Arts Occupa... \n",
495
+ "1 Management, Business, Science, and Arts Occupa... \n",
496
+ "2 Management, Business, Science, and Arts Occupa... \n",
497
+ "3 Management, Business, Science, and Arts Occupa... \n",
498
+ "4 Management, Business, Science, and Arts Occupa... "
499
+ ]
500
+ },
501
+ "execution_count": 63,
502
+ "metadata": {},
503
+ "output_type": "execute_result"
504
+ }
505
+ ],
506
+ "source": [
507
+ "df.head()"
508
+ ]
509
+ },
510
+ {
511
+ "cell_type": "code",
512
+ "execution_count": 64,
513
+ "id": "3f8c4a84-a50e-4dfe-9448-ac69c00750f4",
514
+ "metadata": {},
515
+ "outputs": [],
516
+ "source": [
517
+ "df.to_csv(\"soc-professions-2018.csv\")"
518
+ ]
519
+ },
520
+ {
521
+ "cell_type": "code",
522
+ "execution_count": null,
523
+ "id": "753cbdaf-41a5-4665-b13f-145702b293ec",
524
+ "metadata": {},
525
+ "outputs": [],
526
+ "source": []
527
+ },
528
+ {
529
+ "cell_type": "code",
530
+ "execution_count": null,
531
+ "id": "b44845e3-5a9f-4009-894c-a8e7b43b4d1b",
532
+ "metadata": {},
533
+ "outputs": [],
534
+ "source": []
535
+ }
536
+ ],
537
+ "metadata": {
538
+ "kernelspec": {
539
+ "display_name": "Python 3 (ipykernel)",
540
+ "language": "python",
541
+ "name": "python3"
542
+ },
543
+ "language_info": {
544
+ "codemirror_mode": {
545
+ "name": "ipython",
546
+ "version": 3
547
+ },
548
+ "file_extension": ".py",
549
+ "mimetype": "text/x-python",
550
+ "name": "python",
551
+ "nbconvert_exporter": "python",
552
+ "pygments_lexer": "ipython3",
553
+ "version": "3.8.8"
554
+ }
555
+ },
556
+ "nbformat": 4,
557
+ "nbformat_minor": 5
558
+ }
Assets/Professions/soc-professions-2018.csv ADDED
The diff for this file is too large to render. See raw diff
 
Assets/Professions/soc_2018_direct_match_title_file.csv ADDED
The diff for this file is too large to render. See raw diff
 
Assets/Professions/soc_2018_direct_match_title_file.xlsx ADDED
Binary file (208 kB). View file
 
Assets/Professions/soc_structure_2018.xlsx ADDED
Binary file (51.4 kB). View file
 
app.py CHANGED
@@ -1,6 +1,7 @@
1
  #Import the libraries we know we'll need for the Generator.
2
  import pandas as pd, spacy, nltk, numpy as np, re
3
  from spacy.matcher import Matcher
 
4
  nlp = spacy.load("en_core_web_lg")
5
  from nltk.corpus import wordnet
6
 
 
1
  #Import the libraries we know we'll need for the Generator.
2
  import pandas as pd, spacy, nltk, numpy as np, re
3
  from spacy.matcher import Matcher
4
+ !python -m spacy download en_core_web_lg
5
  nlp = spacy.load("en_core_web_lg")
6
  from nltk.corpus import wordnet
7