国民生产总值饼状图

This report visualizes the data of the life expectancy of the countries across the World. Also, it tries to establish a relationship between life expectancy and GDP per capita of the countries.

该报告显示了世界各国预期寿命的数据。 此外,它试图建立预期寿命与国家人均GDP之间的关系。

A comparative study has been conducted on the top ten and bottom ten countries of 2017 with their life expectancy in 1987. As there is a difference of 30 years, this analysis helped to understand the increase or decrease in the expected years of life in the countries taken into account.

对2017年的前十名和后十名国家进行了比较研究,其预期寿命是1987年。由于相差30年,该分析有助于了解这些国家预期寿命的增加或减少考虑在内。

Moreover, it is very obvious that life expectancy is affected by factors such as happiness, pollution, terrorism, diseases, and many more but I tried to compare the life expectancy with the GDP per capita of each country. As a result, countries with better GDP per capita provided better life expectancy to their citizens in comparison to the countries with a lower GDP per capita.

此外,很明显,预期寿命受到幸福,污染,恐怖主义,疾病等因素的影响,但我试图将预期寿命与每个国家的人均GDP进行比较。 结果,与人均GDP较低的国家相比,人均GDP较高的国家为其公民提供了更好的预期寿命。

Data Sets:

数据集:

Three data sets and two links which have been used in this report are taken from assorted sources. I have downloaded the CSV format files from the source. Merging of all these data sets was performed by using Jupyter notebook from Anaconda. One of the important aspects of big data, i.e. Variety is present due to the diverse sources of data and their integration to analyze and find the required result.

本报告中使用的三个数据集和两个链接来自各种来源。 我已经从源代码下载了CSV格式文件。 通过使用Anaconda的Jupyter笔记本对所有这些数据集进行合并。 大数据的重要方面之一,即多样性,是由于数据源的多样性及其集成以分析和找到所需结果而出现的。

1. Our World in Data: life expectancy

1.我们的数据世界:预期寿命

Our World in Data is an online publication which helps us in understanding the changes in the living conditions across the World. This data set of life expectancy contains data from 1950 to 2017. There are 19206 rows and 4 columns (Country name, country code, Year and Life expectancy) in this data set.

《数据世界》是在线出版物,可帮助我们了解世界各地生活条件的变化。 该预期寿命数据集包含1950年至2017年的数据。此数据集中有19206行和4列(国家/地区名称,国家/地区代码,年份和预期寿命)。

Source: https://ourworldindata.org/life-expectancy

资料来源: https : //ourworldindata.org/life-expectancy

2. World Bank Data: GDP (per capita) by Country and County-wise Population

2.世界银行数据:按国家和县人口的国内生产总值(人均)

The World Bank is headquartered in United States and shares its knowledge for analysis by assorted agencies and individuals. I have collected data of GDP per capita from the following

世界银行总部位于美国,并共享其知识,以供各种机构和个人进行分析。 我从以下收集了人均GDP数据

source: https://data.worldbank.org/indicator/NY.GDP.PCAP.PP.KD and the Population from the following source: https://data.worldbank.org/indicator/SP.POP.TOTL . There are 265 rows and 64 columns in each of the data sets of GDP per capita and Population, respectively.

来源: https : //data.worldbank.org/indicator/NY.GDP.PCAP.PP.KD和来自以下来源的人口: https : //data.worldbank.org/indicator/SP.POP.TOTL 。 每个人均GDP和人口数据集分别有265行和64列。

3. Additional GDPs

3.额外的国内生产总值

Due to the missing values of GDPs of Andorra and Monaco, in spite of populating them with the mean/median/mode of GDP or removing them, I have collected their exact data from following sources: https://www.macrotrends.net/countries/MCO/monaco/gdp-per-capita and https://www.macrotrends.net/countries/AND/andorra/gdp-per-capita

由于缺少安道尔和摩纳哥的GDP值,尽管将其用GDP的均值/中位数/众数填充或除去了它们,但我还是从以下来源收集了它们的确切数据: https : //www.macrotrends.net/国家/ MCO / monaco / gdp-per-capita和https://www.macrotrends.net/countries/AND/andorra/gdp-per-capita

Data processing, cleaning and integration:

数据处理,清理和集成:

First the data sets were downloaded and saved in CSV format. Then GDPs of Andorra and Monaco were updated manually in the CSV. Due to the variety in the sources of my data sets, the name of the countries were slightly different, like, South Korea was mentioned as Korea, Rep., in few places. So, such discrepancies were removed. After this, the CSVs were loaded in Jupyter notebook using read_csv function of pandas library in Python. Three data frames of life expectancy, population and gdp were created for the year 2017. And later, more data frames were created by removing unnecessary columns from the data frames of population and gdp. Later, they were merged with an inner join using the pandas merge function where the column containing the country name (entity) was used as the primary key. Column names were updated using rename function and row containing ‘World’ data was dropped using drop function. Data frame was sorted using sort_values function and top ten and bottom ten countries were selected by using head function and changing the ‘ascending’ parameter of sort_values. Further, similar procedure was followed to get a data frame for the year 1987. Country name (or entity), life expectancy, population and GDP were the columns of my focus.

首先,下载数据集并以CSV格式保存。 然后,在CSV中手动更新了安道尔和摩纳哥的GDP。 由于我的数据集来源各异,因此国家/地区的名称略有不同,例如韩国在很少地方被称为韩国共和国。 因此,消除了这种差异。 之后,使用Python中pandas库的read_csv函数将CSV加载到Jupyter笔记本中。 为2017年创建了三个预期寿命,人口和gdp数据框。后来,通过从人口和gdp数据框中删除不必要的列,创建了更多数据框。 后来,使用pandas合并功能它们与内部联接合并,其中将包含国家/地区名称(实体)的列用作主键。 使用重命名功能更新列名,并使用放置功能删除包含“世界”数据的行。 使用sort_values函数对数据框进行排序,并通过使用head函数并更改sort_values的“升序”参数来选择前十名和后十名国家。 此外,遵循类似的步骤来获得1987年的数据框架。国家名称(或实体),预期寿命,人口和GDP是我关注的列。

Visualization:

可视化:

First and Second Plots: As mentioned in the abstract, the first grouped bar chart compares the life expectancy of top ten countries of 2017 to their life time expectancy in 1987. The second grouped bar chart compares the life expectancy of bottom ten countries of 2017 to their life time expectancy in 1987. Bar function from matplotlib’s pyplot library was used to plot these charts. Grid function was used to show the exact values in best possible way. Color-codes used to plot these charts are: ‘c, ‘lightblue’, ‘darkorange’ and ‘moccasin’ by referring to the named colors link of matplotlib. To choose the colors, a blog from goodly was referred for using the bright color for the main bars and vice versa. As a convention, y-axis of this chart starts from 0. Title of the chart has the font size of 15 while the x and y labels have the font size of 13.5. It’s apparent from chart that in 1987, top 10 countries of 2017 had life expectancies in 70s with San Marino performing best among all, followed by Japan. Where as in 2017, all of them entered in 80s with Monaco performing best followed by San Marino. Also, if we talk about the bottom ten countries of 2017, in 1987, most of them had their life expectancies in 40s except Nigeria having in 50s and Chad touching 60s. And, without much surprise, most of them exceeded in 2017 except Chad which is surprising because it was the best performer of the group in 1987.

第一和第二个图表:如摘要所述,第一个分组的条形图将2017年排名前十的国家的预期寿命与1987年的预期寿命进行比较。第二个分组的条形图将2017年排名前十的国家的预期寿命与第二个组的图表进行比较。的预期寿命是1987年。使用matplotlibpyplot库中的Bar函数绘制这些图表。 网格函数用于以最佳方式显示精确值。 通过引用matplotlib的命名颜色链接,用于绘制这些图表的颜色代码为:'c,'lightblue','darkorange'和'moccasin'。 要选择颜色,最好引用博客,因为主要条使用鲜艳的颜色,反之亦然。 按照惯例,此图表的y轴从0开始。图表的标题的字体大小为15,而x和y标签的字体大小为13.5。 从图表中可以明显看出,1987年,2017年排名前10位的国家的预期寿命为70年代,其中圣马力诺的表现最佳,其次是日本。 与2017年一样,他们都进入了80年代,摩纳哥表现最好,其次是圣马力诺。 另外,如果我们谈论的是2017年排名前十的国家/地区,那就是1987年,除了尼日利亚的50岁和乍得的60岁,大多数人的预期寿命都是40岁。 而且,毫不奇怪,除了乍得,其中大多数人在2017年都超过了,这令人惊讶,因为乍得是1987年该团体中表现最好的。

Third Plot: The third plot is a bubble chart which is plotted using the scatter function of pyplot library. This plot shows the relationship between the life expectancy of the countries with their respective GDP per capita. Variables used to plot this chart are as follows: GDP per capita (on x-axis), life expectancy (on y-axis), bubbles (representing the countries) and the population of countries (as size of bubbles). Title of the chart has the font size of 15 whereas the x and y labels have the font size of 13.5. Due to the large number of countries, colors were randomly assigned to each country by using rand function from numpy. The Population data was converted into millions and the GDP (per capita) was available in US dollars. Marker ‘o’ was used in scatted function to get the shape of bubbles. Grid function was used to show the exact values in best possible way. Albeit, we can’t deny the role of other factors along with the GDP, but, with the available data, countries with the higher GDP performed better in terms of life expectancy.

第三图:第三图是气泡图,使用pyplot库的散点函数绘制。 该图显示了这些国家的预期寿命与其各自的人均GDP之间的关系。 用于绘制此图表的变量如下:人均GDP(在x轴上),预期寿命(在y轴上),泡沫(代表国家)和国家人口(以泡沫的大小表示)。 图表标题的字体大小为15,而x和y标签的字体大小为13.5。 由于国家/地区众多,因此使用numpy中的rand函数将颜色随机分配给每个国家/地区。 人口数据转换为百万,而GDP(人均)可用美元获得。 分散功能中使用了标记“ o”来获得气泡的形状。 网格函数用于以最佳方式显示精确值。 尽管我们不能否认其他因素与GDP的关系,但是根据现有数据,GDP较高的国家在预期寿命方面表现更好。

Conclusion:

结论:

To the best of my understanding, first and second grouped bar charts provides a thorough insight about the increment in the life time expectancy of the countries over the span of 30 years with Chad as only exception. Third chart successfully depicts a positive relationship between the GDP and life expectancy of each country, of course, with few outliers.

据我所知,第一组和第二组条形图提供了有关这些国家在30年内预期寿命增加的透彻见解,但乍得只是一个例外。 第三个图表成功地描绘了每个国家的GDP与预期寿命之间的正向关系,当然,离群值很少。

To get my ipython notebook, please follow this link of Kaggle!

要获取我的ipython笔记本,请点击Kaggle的此链接!

I have shared my own experience in this article. Please share your thoughts if you find anything incorrect here.

我在本文中分享了自己的经验。 如果您发现任何不正确的地方,请分享您的想法。

Twitter: @MrTomarOfficial

推特: @MrTomarOfficial

LinkedIn: https://ie.linkedin.com/in/raghvendra-pratap-singh-tomar

领英(LinkedIn): https : //ie.linkedin.com/in/raghvendra-pratap-singh-tomar

翻译自: https://medium.com/swlh/life-expectancy-and-gdp-6aa13f87fb23

国民生产总值饼状图


http://www.taodudu.cc/news/show-2317945.html

相关文章:

  • matlab如何根据历年gdp找增长规律,中国历年gdp数据图解 中国历年gdp增长率及人均GDP(1978年-2016年)...
  • 关于2020年各省市GDP和各省人均GDP的探索
  • matlab如何根据历年gdp找增长规律,人均gdp增长率_中国历年gdp数据图解 中国历年gdp增长率及人均GDP 1978年 2016年...
  • 2010年中国城市人均GDP排名
  • 【Python】国内生产总值分析预测
  • 2018年中国人均GDP接近1万美元,这在全球处于什么样的水平?
  • 2021年中国国内生产总值(GDP)、GDP结构及人均国内生产总值分析[图]
  • 微信H5活动抽奖单页面模板源码
  • 2022新版H5拼团抽奖拆盲盒模式源码+功能强大
  • 水果机H5抽奖
  • vue 刮刮乐抽奖H5项目
  • H5抽奖十二宫格声音问题
  • H5大转盘抽奖,概率可以控制,可直接使用
  • uni-app,H5抽奖
  • h5php大转盘抽奖,微信公众号H5抽奖幸运大转盘,PHP带后端,微信抽奖大转盘源码可以独立使用...
  • 抽奖h5小游戏还能这么玩?h5抽奖游戏种类详解
  • h5php大转盘抽奖,html5转盘抽奖 完整代码下载(网页版)
  • H5转盘抽奖功能
  • 简易抽奖H5页面demo,九宫格轮盘抽奖,方块轮盘抽奖功能实现
  • 刮刮乐抽奖H5
  • h5完整抽奖系统带php后台(含数据库脚本)
  • h5抽奖大转盘开发笔记小结,涉及到的知识点和包资源
  • H5抽奖小游戏万圣节抓南瓜
  • 转盘抽奖H5
  • 简单的转盘抽奖html,一个很简单的H5的转盘抽奖的(主要用的是css3的属性)
  • js+php+大转盘,H5 Canvas抽奖大转盘代码实现及总结
  • H5拼团抽奖拆盲盒源码/价值几万的H5拼团抽奖拆盲盒模式源码
  • 手摸手。完成一个H5 抽奖功能
  • html5手机app抽奖页面,app H5活动抽奖转盘 前端+后台
  • 基于vue的h5抽奖活动九宫格转盘及圆形转盘

国民生产总值饼状图_预期寿命和国内生产总值相关推荐

  1. mysql 统计做饼状图_使用Highcharts结合PHP与Mysql生成饼状图

    我们在做复杂的数据统计功能时会用到饼状图,饼状图用整个圆表示总体的数量或整体值1,用圆内各个扇形的大小表示各部分数量或该部分占总体的百分比,它可以清晰直观的表示各部分之间以及各部分与整体之间的数量关系 ...

  2. 怎么用python画饼状图_如何使用python的pygal模块画饼状图

    python是一个很有趣的语言,可以在命令行窗口运行.python中有很多功能强大的模块,这篇经验告诉你,如何使用python的pygal模块,画饼状图. 工具/原料 windows系统电脑一台 py ...

  3. java饼状图_使用Vue+echars+Java后端数据生成饼状图

    效果图: 后端controller代码: //图表 @AuthIgnore @PostMapping("getData") public R getData() { long[] ...

  4. 安卓饼状图设置软件_话单及银行卡交易智能分析软件

    一.产品概况: 思迈奥SMILE数据智能分析软件是由我司自主设计与研发的一款结合在公安和检察院的侦查业务经验而定制研发的数据智能分析系统,包含于话单.电子银行账单.及其它数据(个人出行数据.社会资源数 ...

  5. chartcontrol饼状图属性设置_温故而知新,ggplot2 饼图的几点笔记

    其实 ggplot2 并没有类似于 geom_pie() 这样的函数实现饼图的绘制,它是由  geom_bar() 柱状图经过  coord_polar() 极坐标弯曲从而得到的. 对于为什么 ggp ...

  6. 饼状图改变数据显示位置_这么用MatPlotLib视觉化呈现数据,你值得拥有

    全文共6661字,预计学习时长20分钟或更长 图片来源:pexels.com/@divinetechygirl 在现代数字世界中,数据就像空气一样重要. 人们每天都会自觉或不自觉地消费和产生大量数据. ...

  7. python饼状图颜色一样_使用echarts画饼状图,设置饼状图颜色

    前言: 前面已经跟大家分享了使用echarts画柱状图.折线图,一些之前自己遇到的坑也跟大家说了,这次就不再赘述.官方有配置文档,很详细,大家不懂的地方也可以交流. 今日分享重点:画饼状图. 1.引入 ...

  8. python中输出手机话费_用Python生成柱状图、折线图、饼状图来统计自己的手机话费...

    环境 macOS PyCharm 依赖库 matplotlib numpy 中文字体 步骤详解 一.配置依赖包 使用pycharm,直接依赖 matplotlib,如果当前环境变量的pip中不包含 m ...

  9. axure画扇形_如何利用axure制作一个动态的饼状图

    话不多少,先放图! 饼状图 首先,我们来分析一下动态效果 1.鼠标悬浮饼状块颜色发生了改变,且尺寸发生了变化 2.鼠标移入不同的块内,提示框随着鼠标的移动而移动,且提示框内的文字发生了变化.​ ​然 ...

  10. 安卓饼状图设置软件_饼图生成器app下载|饼图生成器安卓版下载_v1.1.0_9ht安卓下载...

    饼图生成器是一款非常好用的饼图生成软件,只需要输入各项名称.数值等就可以一键生成,还可以自定义修改颜色,需要的朋友赶紧下载吧! 饼图生成器介绍 饼图生成器,供您创建各式各样的图表.支持自由布局与-您只 ...

最新文章

  1. Nagios+pnp4nagios+rrdtool 安装配置为nagios添加自定义插件(三)
  2. SAP HUM 使用HU02去Unpack一个HU
  3. html动态生成榜单信息,排行榜.html
  4. 普通视频转高清:10个基于深度学习的超分辨率神经网络
  5. 1131: 零起点学算法38——求阶乘和
  6. 成功解决Instructions for updating:  Use `tf.global_variables_initializer` instead.
  7. 1.16 项目实例:Java图书信息查询
  8. centos rsyslog mysql_centos7+rsyslog+loganalyzer+mysql 搭建rsyslog日志服务器
  9. KDDockWidgets源码编译及安装
  10. [译]PEP 342--增强型生成器:协程
  11. cocos2d-x2.2.5走四棋儿源代码“开源”
  12. 2022最推荐的四款免费bi工具
  13. 淘宝/天猫、1688、京东按图搜索淘宝商品(拍立淘)API接口
  14. 1941. Scary Martian Word
  15. 解决socket:(10106)无法加载或初始化请求的服务提供程序
  16. cvpr 注意力机制_计算机视觉中的注意力机制
  17. kubeadm搭建k8s集群
  18. 云和恩墨多个标杆案例入选《2021年信创产业发展报告》,将持续推动数据库产业进步...
  19. C++ ARX二次开发视图
  20. linux 查看CPU核数

热门文章

  1. centos搭建samba服务
  2. 对LNode*与LinkLinst等价却不等用的理解
  3. that、this、these、those的区别
  4. 中国有哪些python比赛_有哪些大学生值得参与的竞赛?
  5. FAQ(常见问题解答)
  6. python线程池,多线程
  7. 计算机查找的快捷键是,电脑快捷键快速查找
  8. 积分商城使用教程之优惠券
  9. 互联网大文件的传输方式
  10. 如何用10分钟做出一个表情包视频