# pyecharts_world_map **Repository Path**: jiayingb/pyecharts_world_map ## Basic Information - **Project Name**: pyecharts_world_map - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-10-26 - **Last Updated**: 2024-10-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pyecharts_world_map world_map

数据:全球每平方公里的人口密度。截取了1990年与2019年的数据。

概述:当今人口急剧增长,地球人口达到了前所未有的数量,通过观察分析相隔29年-30年的时间,世界各国的人口变化。分析人口增长的原因以及未来对人类发展的影响。

故事:从两张地图的颜色对比可以明显看出,世界人口密度最高的在亚洲,尤其是印度、中国、日本、菲律宾等国家,这30年的时间里,欧洲、南北美洲、澳洲、非洲的人口增长都相对比较缓慢,人口密度不高。 随着人口的高度增长以及人类消费水平的不断提高,人类必然向环境索取越来越多的资源,人口的大量增长,必然会造成对自然资源的不合理的过度开发、地球的资源紧张,人们要对可再生、不可再生资源的利用更加严谨,而且要有效利用资源,提高资源利用率、土地使用率。

In [82]:
import pandas as pd
import csv, os
df = pd.read_csv("Desktop\popular.csv")      
df
Out[82]:
country 1990 2019
0 Burundi 211.8 449.0
1 Comoros 221.2 457.2
2 Djibouti 25.5 42.0
3 Eritrea 22.4 34.6
4 Ethiopia 47.9 112.1
5 Kenya 41.7 92.4
6 Madagascar 19.9 46.4
7 Malawi 99.8 197.6
8 Mauritius 520.1 625.5
9 Mayotte 252.7 709.7
10 Mozambique 16.5 38.6
11 Réunion 244.2 355.6
12 Rwanda 295.5 511.8
13 Seychelles 153.4 212.5
14 Somalia 11.5 24.6
15 South Sudan 9.0 18.1
16 Uganda 86.9 221.6
17 United Republic of Tanzania 28.5 65.5
18 Zambia 10.8 24.0
19 Zimbabwe 27.0 37.9
20 Angola 9.5 25.5
21 Cameroon 24.9 54.7
22 Central African Republic 4.5 7.6
23 Chad 4.7 12.7
24 Congo 6.9 15.8
25 Democratic Republic of the Congo 15.3 38.3
26 Equatorial Guinea 14.9 48.3
27 Gabon 3.7 8.4
28 Sao Tome and Principe 124.2 224.0
29 Botswana 2.3 4.1
... ... ... ...
205 Albania 119.9 105.1
206 Andorra 116.0 164.1
207 Bosnia and Herzegovina 87.5 64.7
208 Croatia 85.4 73.8
209 Gibraltar 2914.9 3370.6
210 Greece 79.3 81.3
211 Holy See 1731.8 1852.3
212 Italy 193.9 205.9
213 Malta 1131.3 1376.2
214 Montenegro 45.7 46.7
215 North Macedonia 79.2 82.6
216 Portugal 108.0 111.7
217 San Marino 402.1 564.4
218 Serbia 108.8 100.3
219 Slovenia 99.6 103.2
220 Spain 78.6 93.7
221 Austria 93.7 108.7
222 Belgium 330.5 381.1
223 France 103.5 118.9
224 Germany 226.8 239.6
225 Liechtenstein 179.9 237.6
226 Luxembourg 147.4 237.7
227 Monaco 19753.7 26152.3
228 Netherlands 443.8 507.0
229 Switzerland 168.4 217.4
230 Bermuda 1232.6 1250.2
231 Canada 3.0 4.1
232 Greenland 0.1 0.1
233 Saint Pierre and Miquelon 27.8 25.3
234 United States of America 27.6 36.0

235 rows × 3 columns

In [83]:
print(list(df.country))
['Burundi', 'Comoros', 'Djibouti', 'Eritrea', 'Ethiopia', 'Kenya', 'Madagascar', 'Malawi', 'Mauritius', 'Mayotte', 'Mozambique', 'Réunion', 'Rwanda', 'Seychelles', 'Somalia', 'South Sudan', 'Uganda', 'United Republic of Tanzania', 'Zambia', 'Zimbabwe', 'Angola', 'Cameroon', 'Central African Republic', 'Chad', 'Congo', 'Democratic Republic of the Congo', 'Equatorial Guinea', 'Gabon', 'Sao Tome and Principe', 'Botswana', 'Eswatini', 'Lesotho', 'Namibia', 'South Africa', 'Benin', 'Burkina Faso', 'Cabo Verde', "C?te d'Ivoire", 'Gambia', 'Ghana', 'Guinea', 'Guinea-Bissau', 'Liberia', 'Mali', 'Mauritania', 'Niger', 'Nigeria', 'Saint Helena', 'Senegal', 'Sierra Leone', 'Togo', 'Algeria', 'Egypt', 'Libya', 'Morocco', 'Sudan', 'Tunisia', 'Western Sahara', 'Armenia', 'Azerbaijan', 'Bahrain', 'Cyprus', 'Georgia', 'Iraq', 'Israel', 'Jordan', 'Kuwait', 'Lebanon', 'Oman', 'Qatar', 'Saudi Arabia', 'State of Palestine', 'Syrian Arab Republic', 'Turkey', 'United Arab Emirates', 'Yemen', 'Kazakhstan', 'Kyrgyzstan', 'Tajikistan', 'Turkmenistan', 'Uzbekistan', 'Afghanistan', 'Bangladesh', 'Bhutan', 'India', 'Iran (Islamic Republic of)', 'Maldives', 'Nepal', 'Pakistan', 'Sri Lanka', 'China', 'China, Hong Kong SAR', 'China, Macao SAR', 'China, Taiwan Province of China', "Dem. People's Republic of Korea", 'Japan', 'Mongolia', 'Republic of Korea', 'Brunei Darussalam', 'Cambodia', 'Indonesia', "Lao People's Democratic Republic", 'Malaysia', 'Myanmar', 'Philippines', 'Singapore', 'Thailand', 'Timor-Leste', 'Viet Nam', 'Anguilla', 'Antigua and Barbuda', 'Aruba', 'Bahamas', 'Barbados', 'Bonaire, Sint Eustatius and Saba', 'British Virgin Islands', 'Cayman Islands', 'Cuba', 'Cura?ao', 'Dominica', 'Dominican Republic', 'Grenada', 'Guadeloupe', 'Haiti', 'Jamaica', 'Martinique', 'Montserrat', 'Puerto Rico', 'Saint Barthélemy', 'Saint Kitts and Nevis', 'Saint Lucia', 'Saint Martin (French part)', 'Saint Vincent and the Grenadines', 'Sint Maarten (Dutch part)', 'Trinidad and Tobago', 'Turks and Caicos Islands', 'United States Virgin Islands', 'Belize', 'Costa Rica', 'El Salvador', 'Guatemala', 'Honduras', 'Mexico', 'Nicaragua', 'Panama', 'Argentina', 'Bolivia (Plurinational State of)', 'Brazil', 'Chile', 'Colombia', 'Ecuador', 'Falkland Islands (Malvinas)', 'French Guiana', 'Guyana', 'Paraguay', 'Peru', 'Suriname', 'Uruguay', 'Venezuela (Bolivarian Republic of)', 'Australia', 'New Zealand', 'Fiji', 'New Caledonia', 'Papua New Guinea', 'Solomon Islands', 'Vanuatu', 'Guam', 'Kiribati', 'Marshall Islands', 'Micronesia (Fed. States of)', 'Nauru', 'Northern Mariana Islands', 'Palau', 'American Samoa', 'Cook Islands', 'French Polynesia', 'Niue', 'Samoa', 'Tokelau', 'Tonga', 'Tuvalu', 'Wallis and Futuna Islands', 'Belarus', 'Bulgaria', 'Czechia', 'Hungary', 'Poland', 'Republic of Moldova', 'Romania', 'Russian Federation', 'Slovakia', 'Ukraine', 'Channel Islands', 'Denmark', 'Estonia', 'Faroe Islands', 'Finland', 'Iceland', 'Ireland', 'Isle of Man', 'Latvia', 'Lithuania', 'Norway', 'Sweden', 'United Kingdom', 'Albania', 'Andorra', 'Bosnia and Herzegovina', 'Croatia', 'Gibraltar', 'Greece', 'Holy See', 'Italy', 'Malta', 'Montenegro', 'North Macedonia', 'Portugal', 'San Marino', 'Serbia', 'Slovenia', 'Spain', 'Austria', 'Belgium', 'France', 'Germany', 'Liechtenstein', 'Luxembourg', 'Monaco', 'Netherlands', 'Switzerland', 'Bermuda', 'Canada', 'Greenland', 'Saint Pierre and Miquelon', 'United States of America']
In [85]:
print(list(df['1990']))
[211.8, 221.2, 25.5, 22.4, 47.9, 41.7, 19.9, 99.8, 520.1, 252.7, 16.5, 244.2, 295.5, 153.4, 11.5, 9.0, 86.9, 28.5, 10.8, 27.0, 9.5, 24.9, 4.5, 4.7, 6.9, 15.3, 14.9, 3.7, 124.2, 2.3, 47.8, 56.1, 1.7, 30.3, 44.2, 32.2, 83.9, 37.5, 94.4, 64.9, 25.9, 34.7, 21.6, 6.9, 2.0, 6.3, 104.5, 17.1, 39.1, 59.8, 69.4, 10.8, 56.4, 2.5, 55.6, 11.4, 53.1, 0.8, 124.3, 87.6, 652.5, 83.0, 77.9, 40.1, 205.6, 40.2, 117.6, 274.0, 5.9, 41.0, 7.6, 349.1, 67.8, 70.1, 21.9, 22.2, 6.1, 22.8, 37.8, 7.8, 48.0, 19.0, 792.6, 13.9, 293.7, 34.6, 743.9, 131.9, 139.6, 276.3, 125.4, 5455.2, 11498.9, 578.3, 168.5, 341.5, 1.4, 441.4, 49.1, 50.8, 100.1, 18.5, 54.9, 63.3, 207.6, 4304.2, 110.7, 49.6, 219.3, 98.8, 142.1, 345.3, 25.6, 606.8, 39.7, 116.6, 105.4, 99.6, 330.4, 93.9, 147.6, 283.3, 239.1, 255.4, 223.4, 338.2, 106.2, 383.7, 243.0, 154.8, 226.3, 594.8, 275.6, 847.5, 238.0, 12.8, 296.4, 8.2, 61.1, 254.3, 86.4, 44.3, 43.2, 34.7, 33.2, 11.9, 6.3, 17.8, 17.9, 29.8, 41.2, 0.2, 1.4, 3.8, 10.6, 17.2, 2.6, 17.8, 22.3, 2.2, 12.9, 39.9, 9.3, 10.2, 11.1, 12.0, 241.6, 89.4, 262.6, 137.6, 475.3, 99.5, 32.7, 236.8, 75.8, 54.6, 9.0, 57.5, 160.4, 132.0, 297.0, 98.5, 50.0, 81.4, 133.9, 114.6, 124.0, 132.9, 102.1, 9.0, 110.0, 88.8, 740.4, 121.2, 36.9, 33.9, 16.4, 2.5, 51.0, 123.3, 42.8, 59.0, 11.6, 20.9, 236.2, 119.9, 116.0, 87.5, 85.4, 2914.9, 79.3, 1731.8, 193.9, 1131.3, 45.7, 79.2, 108.0, 402.1, 108.8, 99.6, 78.6, 93.7, 330.5, 103.5, 226.8, 179.9, 147.4, 19753.7, 443.8, 168.4, 1232.6, 3.0, 0.1, 27.8, 27.6]
In [86]:
print(list(df['2019']))
[449.0, 457.2, 42.0, 34.6, 112.1, 92.4, 46.4, 197.6, 625.5, 709.7, 38.6, 355.6, 511.8, 212.5, 24.6, 18.1, 221.6, 65.5, 24.0, 37.9, 25.5, 54.7, 7.6, 12.7, 15.8, 38.3, 48.3, 8.4, 224.0, 4.1, 66.8, 70.0, 3.0, 48.3, 104.7, 74.3, 136.5, 80.9, 232.0, 133.7, 52.0, 68.3, 51.3, 16.1, 4.4, 18.4, 220.7, 15.5, 84.6, 108.2, 148.6, 18.1, 100.8, 3.9, 81.7, 24.3, 75.3, 2.2, 103.9, 121.6, 2159.4, 129.7, 57.5, 90.5, 393.7, 113.8, 236.1, 670.2, 16.1, 243.9, 15.9, 827.5, 93.0, 108.4, 116.9, 55.2, 6.9, 33.5, 66.6, 12.6, 77.5, 58.3, 1252.6, 20.0, 459.6, 50.9, 1769.9, 199.6, 280.9, 340.0, 152.7, 7082.1, 21419.6, 671.4, 213.2, 348.0, 2.1, 526.8, 82.2, 93.4, 149.4, 31.1, 97.2, 82.7, 362.6, 8291.9, 136.3, 87.0, 311.1, 165.2, 220.7, 590.6, 38.9, 667.5, 79.2, 200.2, 270.6, 106.5, 368.1, 95.7, 222.2, 329.4, 245.7, 408.7, 272.2, 354.3, 49.9, 330.7, 447.9, 203.2, 299.7, 717.0, 283.6, 1246.7, 271.9, 40.2, 298.8, 17.1, 98.9, 311.5, 164.1, 87.1, 65.6, 54.4, 57.1, 16.4, 10.6, 25.3, 25.5, 45.4, 70.0, 0.3, 3.5, 4.0, 17.7, 25.4, 3.7, 19.8, 32.3, 3.3, 18.2, 48.7, 15.5, 19.4, 23.9, 24.6, 309.8, 145.2, 326.6, 162.6, 538.2, 124.4, 39.1, 276.6, 73.1, 76.3, 6.2, 69.6, 133.0, 145.1, 388.5, 81.7, 46.6, 64.5, 138.4, 107.0, 123.7, 123.1, 84.1, 8.9, 113.5, 75.9, 906.7, 136.0, 31.3, 34.9, 18.2, 3.4, 70.9, 148.4, 30.7, 44.0, 14.7, 24.5, 279.1, 105.1, 164.1, 64.7, 73.8, 3370.6, 81.3, 1852.3, 205.9, 1376.2, 46.7, 82.6, 111.7, 564.4, 100.3, 103.2, 93.7, 108.7, 381.1, 118.9, 239.6, 237.6, 237.7, 26152.3, 507.0, 217.4, 1250.2, 4.1, 0.1, 25.3, 36.0]
In [94]:
from pyecharts.faker import Faker

from pyecharts import options as opts
from pyecharts .charts import Map
from pyecharts.globals import ChartType,SymbolType
def map_world() -> Map:
    c = (
        Map()
        .add("人口密度", [list(z) for z in zip(list(df.country),list(df['1990']))], "world")
        .set_series_opts(label_opts=opts.LabelOpts(is_show=False))
        .set_global_opts(
            title_opts=opts.TitleOpts(title="Map_世界地图"),
            visualmap_opts=opts.VisualMapOpts(max_=300),
        )
       
    )
    return c

map_world().render_notebook()
Out[94]:
In [93]:
from pyecharts.faker import Faker

from pyecharts import options as opts
from pyecharts .charts import Map
from pyecharts.globals import ChartType,SymbolType
def map_world() -> Map:
    c = (
        Map()
        .add("人口密度", [list(z) for z in zip(list(df.country),list(df['2019']))], "world")
        .set_series_opts(label_opts=opts.LabelOpts(is_show=False))
        .set_global_opts(
            title_opts=opts.TitleOpts(title="Map_世界地图"),
            visualmap_opts=opts.VisualMapOpts(max_=300),
        )
       
    )
    return c

map_world().render_notebook()
Out[93]:
In [ ]:
 
In [ ]: