|
35 | 35 | "cell_type": "markdown",
|
36 | 36 | "metadata": {},
|
37 | 37 | "source": [
|
38 |
| - "* print top 5 rows of world data-frame" |
| 38 | + "**Print the top 5 rows of world dataframe.**" |
39 | 39 | ]
|
40 | 40 | },
|
41 | 41 | {
|
|
54 | 54 | "cell_type": "markdown",
|
55 | 55 | "metadata": {},
|
56 | 56 | "source": [
|
57 |
| - "* remove continents which have only one country in data-frame\n" |
| 57 | + "**Remove continents which have only one country in dataframe.**\n" |
58 | 58 | ]
|
59 | 59 | },
|
60 | 60 | {
|
61 | 61 | "cell_type": "code",
|
62 |
| - "execution_count": null, |
| 62 | + "execution_count": 1, |
63 | 63 | "metadata": {
|
64 | 64 | "ExecuteTime": {
|
65 | 65 | "end_time": "2020-04-23T18:44:33.661829Z",
|
|
68 | 68 | },
|
69 | 69 | "outputs": [],
|
70 | 70 | "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" |
77 | 81 | ]
|
78 | 82 | },
|
79 | 83 | {
|
80 | 84 | "cell_type": "markdown",
|
81 | 85 | "metadata": {},
|
82 | 86 | "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" |
85 | 88 | ]
|
86 | 89 | },
|
87 | 90 | {
|
|
100 | 103 | "cell_type": "markdown",
|
101 | 104 | "metadata": {},
|
102 | 105 | "source": [
|
103 |
| - "* print 'world_filtered' data-frame" |
| 106 | + "**Print the 'world_filtered' dataframe.**" |
104 | 107 | ]
|
105 | 108 | },
|
106 | 109 | {
|
|
119 | 122 | "cell_type": "markdown",
|
120 | 123 | "metadata": {},
|
121 | 124 | "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", |
126 | 133 | "\n",
|
127 | 134 | "> #### Notes\n",
|
128 | 135 | "> * the colors of countries from 'world_filtered' are based on population\n",
|
|
150 | 157 | "\n",
|
151 | 158 | "\n",
|
152 | 159 | "\n",
|
| 160 | + "\n", |
153 | 161 | "# add the rest of the countries"
|
154 | 162 | ]
|
155 | 163 | },
|
|
160 | 168 | "outputs": [],
|
161 | 169 | "source": []
|
162 | 170 | },
|
163 |
| - { |
164 |
| - "cell_type": "markdown", |
165 |
| - "metadata": {}, |
166 |
| - "source": [ |
167 |
| - "### Plotly" |
168 |
| - ] |
169 |
| - }, |
170 | 171 | {
|
171 | 172 | "cell_type": "code",
|
172 | 173 | "execution_count": null,
|
|
181 | 182 | "outputs": [],
|
182 | 183 | "source": []
|
183 | 184 | },
|
| 185 | + { |
| 186 | + "cell_type": "markdown", |
| 187 | + "metadata": {}, |
| 188 | + "source": [ |
| 189 | + "### Plotly" |
| 190 | + ] |
| 191 | + }, |
184 | 192 | {
|
185 | 193 | "cell_type": "code",
|
186 | 194 | "execution_count": null,
|
|
206 | 214 | "cell_type": "markdown",
|
207 | 215 | "metadata": {},
|
208 | 216 | "source": [
|
209 |
| - "## Part II:\n", |
| 217 | + "-----------\n", |
| 218 | + "## Part II: More Geopandas\n", |
210 | 219 | "\n",
|
211 | 220 | "In Geopandas:\n",
|
212 | 221 | "\n",
|
213 | 222 | "* 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` " |
216 | 225 | ]
|
217 | 226 | },
|
218 | 227 | {
|
|
284 | 293 | "name": "python",
|
285 | 294 | "nbconvert_exporter": "python",
|
286 | 295 | "pygments_lexer": "ipython3",
|
287 |
| - "version": "3.7.6" |
| 296 | + "version": "3.7.9" |
288 | 297 | },
|
289 | 298 | "toc": {
|
290 | 299 | "base_numbering": 1,
|
|
0 commit comments