Python Pandas outlines for data analysis for World Development Indicators. The data is [here][Pandas analysis].
Population dynamics |
Source code
The following outlines the Python code used:
import numpy as np import pandas as pd import sys import matplotlib.pyplot as plt xval = 'Violent Crime'; yval = 'Murder'; file='1111' ver=pd.read_csv("city.csv") plt.xlabel(xval) plt.ylabel(yval) plt.scatter(ver[xval],ver[yval]) plt.show() f2= file+".svg" plt.savefig(f2,format='SVG') f2= file+".png" plt.savefig(f2,format='PNG')
Data
The data used is [here]
,Population,Annual population growth,Ages 0-14,Ages 15-64,Ages 65+,young population,working-age population,Crude death rate,Crude birth rate Afghanistan,31.6,3.4,45,53,2,85,5,8,34 Albania,2.9,-0.5,19,69,12,27,17,7,13 Algeria,38.9,1.6,28,66,6,43,9,5,24 American Samoa,0.1,-0.3,0,0,0,0,0,0,0 Andorra,0.1,0.8,0,0,0,0,0,0,0 Angola,24.2,3.4,48,50,2,96,5,14,45 Antigua and Barbuda,0.1,1.1,25,68,7,36,10,6,16 Argentina,43,1.1,25,64,11,40,17,8,18 Armenia,3,-0.2,19,71,11,26,15,9,13 Aruba,0.1,0.9,19,69,12,27,17,9,10 Australia,23.5,1.5,19,67,15,28,22,7,13 Austria,8.5,0.5,14,67,19,21,28,9,10 Azerbaijan,9.5,1.2,22,72,6,30,8,6,18 "Bahamas, The",0.4,1.8,21,71,8,30,11,6,15 Bahrain,1.4,5.1,21,76,2,28,3,2,15 Bangladesh,159.1,1.4,30,65,5,46,8,5,20 Barbados,0.3,0.3,19,67,14,29,21,11,12 Belarus,9.5,-0.4,16,70,14,22,20,13,13 Belgium,11.2,0.7,17,65,18,26,28,9,11 Belize,0.4,2.5,33,63,4,52,6,6,23 Benin,10.6,3,42,55,3,78,5,9,36 Bermuda,0.1,0.4,0,0,0,0,0,8,11 Bhutan,0.8,2.2,27,68,5,41,7,6,18 Bolivia,10.6,1.7,33,61,6,54,10,7,24 Bosnia and Herzegovina,3.8,0,14,71,15,19,21,11,9 Botswana,2.2,1.8,32,64,4,50,6,7,25 Brazil,206.1,1.1,24,69,8,34,11,6,15 Brunei Darussalam,0.4,1.7,24,72,4,33,6,3,16 Bulgaria,7.2,-0.9,14,66,20,21,30,15,9 Burkina Faso,17.6,3,46,52,2,88,5,10,40 Burundi,10.8,3.4,45,53,2,84,5,11,44 Cabo Verde,0.5,1.1,30,65,5,46,7,5,21 Cambodia,15.3,1.6,32,64,4,50,6,6,24 Cameroon,22.8,2.6,43,54,3,79,6,11,37 Canada,35.5,1,16,68,16,23,23,7,11 Cayman Islands,0.1,2.5,0,0,0,0,0,0,0 Central African Republic,4.8,1.8,39,57,4,69,7,15,34 Chad,13.6,3.5,48,50,2,97,5,14,45 Channel Islands,0.2,0.7,15,68,17,22,25,9,9 Chile,17.8,1.1,20,69,11,30,16,5,13 China,"1,364.30",0.6,17,74,9,23,12,7,12 "Hong Kong SAR, China",7.2,0.6,12,74,15,16,20,6,9 "Macao SAR, China",0.6,2.1,13,79,9,16,11,5,12 Colombia,47.8,1.2,25,69,7,36,10,6,16 Comoros,0.8,2.4,40,57,3,71,5,8,34 "Congo, Dem. Rep.",74.9,3.2,46,51,3,91,6,10,42 "Congo, Rep.",4.5,2.6,43,54,4,79,7,9,37 Costa Rica,4.8,1.4,23,69,9,33,13,5,15 Cote d'Ivoire,22.2,2.1,43,54,3,79,6,14,37 Croatia,4.2,-0.3,15,66,19,23,28,12,9 Cuba,11.4,0.2,17,70,14,24,19,8,10 Curacao,0.2,1.1,19,66,14,29,22,9,13 Cyprus,1.2,1.4,17,71,13,24,18,7,11 Czech Republic,10.5,0.2,15,68,18,22,26,10,10 Denmark,5.6,0.4,17,64,18,26,29,9,10 Djibouti,0.9,1.4,33,63,4,52,7,9,25 Dominica,0.1,0.3,0,0,0,0,0,0,0 Dominican Republic,10.4,1.4,30,63,7,48,10,6,21 Ecuador,15.9,1.6,29,64,7,46,10,5,21 "Egypt, Arab Rep.",89.6,1.9,33,62,5,53,8,6,28 El Salvador,6.1,0.4,28,64,8,43,12,7,17 Equatorial Guinea,0.8,3.1,39,58,3,68,5,11,35 Eritrea,0,0,0,0,0,0,0,7,34 Estonia,1.3,-0.4,16,66,19,24,28,12,10 Ethiopia,97,2.7,42,54,3,77,6,7,32 Faroe Islands,0,0.3,0,0,0,0,0,8,13 Fiji,0.9,0.6,29,66,6,44,9,7,20 Finland,5.5,0.4,16,64,20,26,31,10,11 France,66.5,0.6,19,63,19,29,30,8,12 French Polynesia,0.3,1.2,22,70,7,32,10,6,16 Gabon,1.7,2.3,37,58,5,65,9,9,30 "Gambia, The",1.9,3.2,46,51,2,90,5,9,42 Georgia,3.7,-1.2,17,69,14,25,21,12,14 Germany,81,-0.1,13,66,21,20,32,11,9 Ghana,26.8,2.5,39,58,3,67,6,9,33 Greece,10.9,0.1,15,64,21,23,32,11,9 Greenland,0.1,0,0,0,0,0,0,8,14 Grenada,0.1,0.3,27,66,7,40,11,7,19 Guam,0.2,0.5,26,66,8,39,13,5,17 Guatemala,16,2.2,37,58,5,64,8,5,27 Guinea,12.3,2.4,43,54,3,79,6,10,37 Guinea-Bissau,1.8,2.2,41,56,3,73,6,12,37 Guyana,0.8,0.2,30,65,5,46,7,8,19 Haiti,10.6,1.5,34,61,5,56,7,9,25 Honduras,8,1.7,33,63,5,52,8,5,21 Hungary,9.9,-0.2,15,68,18,21,26,13,10 Iceland,0.3,1.1,20,66,13,31,20,6,13 India,"1,295.30",1.5,29,65,5,45,8,7,20 Indonesia,254.5,1.3,28,67,5,42,8,7,20 "Iran, Islamic Rep.",78.1,1.2,24,72,5,33,7,5,18 Iraq,35.3,2.9,41,56,3,74,5,5,35 Ireland,4.6,1.4,22,66,13,33,19,6,14 Isle of Man,0.1,0.9,0,0,0,0,0,0,0 Israel,8.2,1.9,28,61,11,45,18,5,21 Italy,60.8,0.5,14,64,22,21,34,10,8 Jamaica,2.7,0.4,24,67,9,36,13,6,14 Japan,127.1,0,13,61,26,21,42,10,8 Jordan,7.4,3.2,36,60,4,59,6,4,27 Kazakhstan,17.3,1.1,26,67,7,39,10,8,23 Kenya,44.9,2.6,42,55,3,76,5,8,35 Kiribati,0.1,1.9,35,61,4,57,6,7,29 "Korea, Dem. People's Rep.",25,0.7,21,69,10,31,14,9,14 "Korea, Rep.",50.4,0.5,14,73,13,20,17,5,9 Kosovo,1.8,0.5,0,0,0,0,0,7,17 Kuwait,3.8,4.8,22,76,2,30,3,3,20 Kyrgyz Republic,5.8,1.3,31,65,4,48,7,6,28 Lao PDR,6.7,1.6,35,61,4,57,6,7,27 Latvia,2,-1.2,15,66,19,22,29,14,11 Lebanon,5.6,3.9,24,68,8,35,12,5,15 Lesotho,2.1,0.9,36,60,4,61,7,15,29 Liberia,4.4,3,43,54,3,78,6,9,35 Libya,6.3,1.1,30,66,4,45,7,5,21 Liechtenstein,0,0.8,0,0,0,0,0,7,10 Lithuania,2.9,-1.3,14,67,19,22,28,14,10 Luxembourg,0.6,1.7,17,69,14,24,20,7,11 "Macedonia, FYR",2.1,0.2,17,71,12,24,17,9,11 Madagascar,23.6,2.9,42,55,3,76,5,7,34 Malawi,16.7,2.9,45,51,3,89,7,8,39 Malaysia,29.9,1.7,25,69,6,37,8,5,17 Maldives,0.4,2.4,28,68,5,41,7,4,21 Mali,17.1,3.1,48,50,3,95,5,10,44 Malta,0.4,0.8,15,67,19,22,28,8,10 Marshall Islands,0.1,0.1,0,0,0,0,0,0,0 Mauritania,4,2.7,40,57,3,71,6,8,33 Mauritius,1.3,0.4,20,71,9,28,13,8,11 Mexico,125.4,1.4,28,66,6,43,10,5,19 "Micronesia, Fed. Sts.",0.1,-0.2,35,61,4,56,7,6,24 Moldova,3.6,-0.2,16,74,10,21,13,11,11 Monaco,0,1.1,0,0,0,0,0,0,0 Mongolia,2.9,1.4,28,68,4,41,6,6,24 Montenegro,0.6,0.2,19,68,13,28,20,10,12 Morocco,33.9,1.1,27,67,6,41,9,6,21 Mozambique,27.2,2.8,46,51,3,89,7,11,39 Myanmar,53.4,0.8,28,67,5,42,8,8,18 Namibia,2.4,1.7,37,60,4,62,6,7,30 Nepal,28.2,1.2,34,61,5,55,9,6,21 Netherlands,16.9,0.4,17,66,18,25,27,8,10 New Caledonia,0.3,1.6,22,68,10,33,15,5,17 New Zealand,4.5,1.1,20,65,14,31,22,7,13 Nicaragua,6,1.3,31,65,5,47,8,5,20 Niger,19.1,3.8,50,47,3,107,5,9,49 Nigeria,177.5,2.6,44,53,3,83,5,13,40 Northern Mariana Islands,0.1,-1.6,0,0,0,0,0,0,0 Norway,5.1,1,18,66,16,27,24,8,12 Oman,4.2,4.6,21,76,3,28,3,3,20 Pakistan,185,2.1,35,60,4,58,7,7,29 Palau,0,0.7,0,0,0,0,0,0,0 Panama,3.9,1.7,27,65,7,42,11,5,19 Papua New Guinea,7.5,2.3,38,59,3,63,5,8,29 Paraguay,6.6,1.5,31,64,6,48,9,6,21 Peru,31,1.3,28,65,7,43,10,6,20 Philippines,99.1,1.7,32,63,4,51,7,7,24 Poland,38,0,15,70,15,21,21,10,10 Portugal,10.4,0.1,14,65,20,22,31,10,8 Puerto Rico,3.5,-0.5,19,67,14,29,21,8,10 Qatar,2.2,9.3,15,84,1,18,1,1,12 Romania,19.9,-0.9,16,67,17,23,25,13,9 Russian Federation,143.8,-0.1,16,70,13,23,19,13,13 Rwanda,11.3,2.5,41,56,3,74,5,7,32 Samoa,0.2,0.7,38,57,5,65,9,5,26 San Marino,0,1,0,0,0,0,0,8,9 Sao Tome and Principe,0.2,2.2,43,54,3,79,6,7,34 Saudi Arabia,30.9,2.6,29,68,3,42,4,3,20 Senegal,14.7,2.8,44,53,3,82,6,6,38 Serbia,7.1,-0.4,16,67,17,25,25,14,9 Seychelles,0.1,0.9,23,70,7,33,10,8,17 Sierra Leone,6.3,3.2,43,55,3,78,5,14,36 Singapore,5.5,2.2,16,73,11,22,15,5,10 Sint Maarten (Dutch part),0,1.5,0,0,0,0,0,0,0 Slovak Republic,5.4,0,15,71,13,21,19,10,10 Slovenia,2.1,0.3,15,68,18,22,26,9,10 Solomon Islands,0.6,2.3,40,57,3,70,6,6,30 Somalia,10.5,2.5,47,50,3,93,6,12,44 South Africa,54.1,1.5,30,65,5,45,8,12,21 South Sudan,11.9,4.1,42,54,3,78,6,12,37 Spain,46.5,1,15,67,18,22,28,9,9 Sri Lanka,20.8,0.8,25,66,9,37,13,7,16 St. Kitts and Nevis,0.1,1.3,0,0,0,0,0,0,0 St. Lucia,0.2,1.1,24,68,9,35,13,7,15 St. Martin (French part),0,0.8,0,0,0,0,0,4,16 St. Vincent and the Grenadines,0.1,0.1,25,68,7,37,11,7,16 Sudan,39.4,2.4,41,56,3,73,6,8,33 Suriname,0.5,0.8,27,66,7,41,10,7,18 Swaziland,1.3,1.3,38,59,4,64,6,14,30 Sweden,9.7,0.6,17,63,20,27,31,9,12 Switzerland,8.2,0.9,15,67,18,22,26,8,10 Syrian Arab Republic,18.8,1,37,59,4,62,7,6,23 Tajikistan,8.3,2.1,35,62,3,56,5,6,31 Tanzania,51.8,3,45,52,3,88,6,7,39 Thailand,67.7,0.6,18,72,10,25,14,8,11 Timor-Leste,1.2,2.6,42,52,5,81,11,7,38 Togo,7.1,2.7,42,55,3,77,5,9,36 Tonga,0.1,0.5,37,57,6,65,10,6,25 Trinidad and Tobago,1.4,0.5,21,70,9,30,13,9,14 Tunisia,11,1,23,69,7,34,11,6,19 Turkey,77.5,1.5,26,67,7,39,11,6,17 Turkmenistan,5.3,1.2,28,67,4,42,6,8,21 Turks and Caicos Islands,0,4.1,0,0,0,0,0,0,0 Tuvalu,0,0.4,0,0,0,0,0,0,0 Uganda,37.8,3.3,48,49,2,98,5,10,43 Ukraine,45.4,-0.6,15,70,15,21,22,15,11 United Arab Emirates,9.1,7.8,14,85,1,16,1,2,11 United Kingdom,64.6,0.7,18,65,17,27,27,9,12 United States,318.9,0.9,19,67,14,29,22,8,13 Uruguay,3.4,0.2,22,64,14,34,22,9,14 Uzbekistan,30.8,1.6,29,67,5,43,7,5,23 Vanuatu,0.3,2.4,37,59,4,62,7,5,26 "Venezuela, RB",30.7,1.6,28,65,6,43,9,6,20 Vietnam,90.7,1.1,23,70,7,33,9,6,17 Virgin Islands (U.S.),0.1,-0.3,20,63,17,33,27,8,11 West Bank and Gaza,4.3,2.8,41,57,3,72,5,4,33 "Yemen, Rep.",26.2,2.8,41,57,3,72,5,7,32 Zambia,15.7,2.8,46,51,3,90,6,9,40 Zimbabwe,15.2,1.4,42,55,3,75,5,10,35