Skip to content

Commit e4fb7c1

Browse files
committed
Update maps_exercise.ipynb
Improved readability
1 parent 5a5015d commit e4fb7c1

File tree

1 file changed

+36
-27
lines changed

1 file changed

+36
-27
lines changed

maps_exercise.ipynb

+36-27
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"cell_type": "markdown",
3636
"metadata": {},
3737
"source": [
38-
"* print top 5 rows of world data-frame"
38+
"**Print the top 5 rows of world dataframe.**"
3939
]
4040
},
4141
{
@@ -54,12 +54,12 @@
5454
"cell_type": "markdown",
5555
"metadata": {},
5656
"source": [
57-
"* remove continents which have only one country in data-frame\n"
57+
"**Remove continents which have only one country in dataframe.**\n"
5858
]
5959
},
6060
{
6161
"cell_type": "code",
62-
"execution_count": null,
62+
"execution_count": 1,
6363
"metadata": {
6464
"ExecuteTime": {
6565
"end_time": "2020-04-23T18:44:33.661829Z",
@@ -68,20 +68,23 @@
6868
},
6969
"outputs": [],
7070
"source": [
71-
"# continents with only one country\n",
72-
"\n",
73-
"\n",
74-
"\n",
75-
"# remove these continents\n",
76-
"\n"
71+
"# continents with only one country\n"
72+
]
73+
},
74+
{
75+
"cell_type": "code",
76+
"execution_count": null,
77+
"metadata": {},
78+
"outputs": [],
79+
"source": [
80+
"# remove these continents"
7781
]
7882
},
7983
{
8084
"cell_type": "markdown",
8185
"metadata": {},
8286
"source": [
83-
"* create dataframe with top 3 most populated countries from each continent\n",
84-
"* store the result in data-frame with name 'world_filtered'"
87+
"**Create dataframe with top 3 most populated countries from each continent and store the result in dataframe with name 'world_filtered'.**\n"
8588
]
8689
},
8790
{
@@ -100,7 +103,7 @@
100103
"cell_type": "markdown",
101104
"metadata": {},
102105
"source": [
103-
"* print 'world_filtered' data-frame"
106+
"**Print the 'world_filtered' dataframe.**"
104107
]
105108
},
106109
{
@@ -119,10 +122,14 @@
119122
"cell_type": "markdown",
120123
"metadata": {},
121124
"source": [
122-
"## Part I: \n",
123-
"Create choropleth map of world:\n",
124-
" - using **Geopandas**\n",
125-
" - using **Plotly**\n",
125+
"-----------------\n",
126+
"## Part I: Create a choropleth map of world:\n",
127+
"\n",
128+
" - First using **Geopandas**\n",
129+
" - Note: Geopandas may not work well on your computers, especially on Windows computers, it is advised to use Google Collab for this assignment. \n",
130+
" - Second using **Plotly**\n",
131+
" - Note: Plotly may not work well on Jupyter Labs, it is advised to use Jupyter Notebooks or Google Collab for the plotly portion. \n",
132+
"\n",
126133
"\n",
127134
"> #### Notes\n",
128135
"> * the colors of countries from 'world_filtered' are based on population\n",
@@ -150,6 +157,7 @@
150157
"\n",
151158
"\n",
152159
"\n",
160+
"\n",
153161
"# add the rest of the countries"
154162
]
155163
},
@@ -160,13 +168,6 @@
160168
"outputs": [],
161169
"source": []
162170
},
163-
{
164-
"cell_type": "markdown",
165-
"metadata": {},
166-
"source": [
167-
"### Plotly"
168-
]
169-
},
170171
{
171172
"cell_type": "code",
172173
"execution_count": null,
@@ -181,6 +182,13 @@
181182
"outputs": [],
182183
"source": []
183184
},
185+
{
186+
"cell_type": "markdown",
187+
"metadata": {},
188+
"source": [
189+
"### Plotly"
190+
]
191+
},
184192
{
185193
"cell_type": "code",
186194
"execution_count": null,
@@ -206,13 +214,14 @@
206214
"cell_type": "markdown",
207215
"metadata": {},
208216
"source": [
209-
"## Part II:\n",
217+
"-----------\n",
218+
"## Part II: More Geopandas\n",
210219
"\n",
211220
"In Geopandas:\n",
212221
"\n",
213222
"* add New York, Berlin, Paris, Toronto, Calgary, Tokyo to the map you have created before\n",
214-
"* to get geometry of these cities use gpd.tools.geocode(['New York', 'Berlin', 'Paris','Toronto', 'Calgary', 'Tokyo'])\n",
215-
"* if you do not have geopy library instaled, install it with the following command in the jupyter notebook cell `!pip install geopy`"
223+
" * to get geometry of these cities use the function, **gpd.tools.geocode**(['New York', 'Berlin', 'Paris','Toronto', 'Calgary', 'Tokyo'])\n",
224+
" * if you do not have the geopy library instaled, install it with the following command **in the jupyter notebook cell** `!pip install geopy` "
216225
]
217226
},
218227
{
@@ -284,7 +293,7 @@
284293
"name": "python",
285294
"nbconvert_exporter": "python",
286295
"pygments_lexer": "ipython3",
287-
"version": "3.7.6"
296+
"version": "3.7.9"
288297
},
289298
"toc": {
290299
"base_numbering": 1,

0 commit comments

Comments
 (0)