In [64]:
import numpy as np
import pandas as pd
In [65]:
#Importar fichero csv
# Descargar el fichero de Población, Total Mundial Mundial
#http://datos.bancomundial.org/indicador/SP.POP.TOTL
#API_SP.POP.TOTL_DS2_es_csv_v2.csv
In [66]:
fichero = 'API_SP.POP.TOTL_DS2_es_csv_v2.csv'
In [67]:
df = pd.read_csv(fichero,sep=',',header=1,skiprows=2) #Lee un fichero csv
In [68]:
df.info() # Expone información pertinente del DataFrame
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 264 entries, 0 to 263
Data columns (total 62 columns):
Country Name 264 non-null object
Country Code 264 non-null object
Indicator Name 264 non-null object
Indicator Code 264 non-null object
1960 260 non-null float64
1961 260 non-null float64
1962 260 non-null float64
1963 260 non-null float64
1964 260 non-null float64
1965 260 non-null float64
1966 260 non-null float64
1967 260 non-null float64
1968 260 non-null float64
1969 260 non-null float64
1970 260 non-null float64
1971 260 non-null float64
1972 260 non-null float64
1973 260 non-null float64
1974 260 non-null float64
1975 260 non-null float64
1976 260 non-null float64
1977 260 non-null float64
1978 260 non-null float64
1979 260 non-null float64
1980 260 non-null float64
1981 260 non-null float64
1982 260 non-null float64
1983 260 non-null float64
1984 260 non-null float64
1985 260 non-null float64
1986 260 non-null float64
1987 260 non-null float64
1988 260 non-null float64
1989 260 non-null float64
1990 262 non-null float64
1991 262 non-null float64
1992 261 non-null float64
1993 261 non-null float64
1994 261 non-null float64
1995 262 non-null float64
1996 262 non-null float64
1997 262 non-null float64
1998 263 non-null float64
1999 263 non-null float64
2000 263 non-null float64
2001 263 non-null float64
2002 263 non-null float64
2003 263 non-null float64
2004 263 non-null float64
2005 263 non-null float64
2006 263 non-null float64
2007 263 non-null float64
2008 263 non-null float64
2009 263 non-null float64
2010 263 non-null float64
2011 263 non-null float64
2012 262 non-null float64
2013 262 non-null float64
2014 262 non-null float64
2015 262 non-null float64
2016 0 non-null float64
Unnamed: 61 0 non-null float64
dtypes: float64(58), object(4)
memory usage: 128.0+ KB
In [69]:
df.head() # mostrar cabecera con los primeros n filas, por defecto n es igual a 5
Out[69]:
Country Name
Country Code
Indicator Name
Indicator Code
1960
1961
1962
1963
1964
1965
...
2008
2009
2010
2011
2012
2013
2014
2015
2016
Unnamed: 61
0
Aruba
ABW
Población, total
SP.POP.TOTL
54208.0
55435.0
56226.0
56697.0
57029.0
57360.0
...
101342.0
101416.0
101597.0
101936.0
102393.0
102921.0
103441.0
103889.0
NaN
NaN
1
Afganistán
AFG
Población, total
SP.POP.TOTL
8994793.0
9164945.0
9343772.0
9531555.0
9728645.0
9935358.0
...
26528741.0
27207291.0
27962207.0
28809167.0
29726803.0
30682500.0
31627506.0
32526562.0
NaN
NaN
2
Angola
AGO
Población, total
SP.POP.TOTL
5270844.0
5367287.0
5465905.0
5565808.0
5665701.0
5765025.0
...
19842251.0
20520103.0
21219954.0
21942296.0
22685632.0
23448202.0
24227524.0
25021974.0
NaN
NaN
3
Albania
ALB
Población, total
SP.POP.TOTL
1608800.0
1659800.0
1711319.0
1762621.0
1814135.0
1864791.0
...
2947314.0
2927519.0
2913021.0
2904780.0
2900247.0
2896652.0
2893654.0
2889167.0
NaN
NaN
4
Andorra
AND
Población, total
SP.POP.TOTL
13414.0
14376.0
15376.0
16410.0
17470.0
18551.0
...
85616.0
85474.0
84419.0
82326.0
79316.0
75902.0
72786.0
70473.0
NaN
NaN
5 rows × 62 columns
In [70]:
df.tail() # mostrar cabecera con las ultimas n filas, por defecto n es igual a 5
Out[70]:
Country Name
Country Code
Indicator Name
Indicator Code
1960
1961
1962
1963
1964
1965
...
2008
2009
2010
2011
2012
2013
2014
2015
2016
Unnamed: 61
259
Kosovo
XKX
Población, total
SP.POP.TOTL
947000.0
966000.0
994000.0
1022000.0
1050000.0
1078000.0
...
1747383.0
1761474.0
1775680.0
1790957.0
1805200.0
1818117.0
1812771.0
1797151.0
NaN
NaN
260
Yemen, Rep. del
YEM
Población, total
SP.POP.TOTL
5166311.0
5251663.0
5339285.0
5429501.0
5522690.0
5619170.0
...
22322699.0
22954226.0
23591972.0
24234940.0
24882792.0
25533217.0
26183676.0
26832215.0
NaN
NaN
261
Sudáfrica
ZAF
Población, total
SP.POP.TOTL
17396000.0
17949962.0
18459442.0
18936138.0
19390554.0
19832000.0
...
49296223.0
50020918.0
50771826.0
51549958.0
52356381.0
53192216.0
54058647.0
54956920.0
NaN
NaN
262
Zambia
ZMB
Población, total
SP.POP.TOTL
3049586.0
3142848.0
3240664.0
3342894.0
3449266.0
3559687.0
...
13114579.0
13507849.0
13917439.0
14343526.0
14786581.0
15246086.0
15721343.0
16211767.0
NaN
NaN
263
Zimbabwe
ZWE
Población, total
SP.POP.TOTL
3752390.0
3876638.0
4006262.0
4140804.0
4279561.0
4422132.0
...
13495462.0
13720997.0
13973897.0
14255592.0
14565482.0
14898092.0
15245855.0
15602751.0
NaN
NaN
5 rows × 62 columns
In [71]:
df[['Country Name','2015']] # Población al 2015
Out[71]:
Country Name
2015
0
Aruba
1.038890e+05
1
Afganistán
3.252656e+07
2
Angola
2.502197e+07
3
Albania
2.889167e+06
4
Andorra
7.047300e+04
5
El mundo árabe
3.920223e+08
6
Emiratos Árabes Unidos
9.156963e+06
7
Argentina
4.341676e+07
8
Armenia
3.017712e+06
9
Samoa Americana
5.553800e+04
10
Antigua y Barbuda
9.181800e+04
11
Australia
2.378117e+07
12
Austria
8.611088e+06
13
Azerbaiyán
9.651349e+06
14
Burundi
1.117892e+07
15
Bélgica
1.128572e+07
16
Benin
1.087983e+07
17
Burkina Faso
1.810557e+07
18
Bangladesh
1.609956e+08
19
Bulgaria
7.177991e+06
20
Bahrein
1.377237e+06
21
Bahamas
3.880190e+05
22
Bosnia y Herzegovina
3.810416e+06
23
Belarús
9.513000e+06
24
Belice
3.592870e+05
25
Bermudas
6.523500e+04
26
Bolivia
1.072470e+07
27
Brasil
2.078475e+08
28
Barbados
2.842150e+05
29
Brunei Darussalam
4.231880e+05
...
...
...
234
América Latina y el Caribe (BIRF y la AIF)
6.168626e+08
235
Timor-Leste
1.245015e+06
236
Oriente Medio y Norte de África (BIRF y la AIF)
3.581388e+08
237
Tonga
1.061700e+05
238
Asia meridional (BIRF y la AIF)
1.744161e+09
239
África al sur del Sahara (BIRF y la AIF)
1.000981e+09
240
Trinidad y Tobago
1.360088e+06
241
Túnez
1.110780e+07
242
Turquía
7.866583e+07
243
Tuvalu
9.916000e+03
244
Tanzanía
5.347042e+07
245
Uganda
3.903238e+07
246
Ucrania
4.519820e+07
247
Ingreso mediano alto
2.593743e+09
248
Uruguay
3.431555e+06
249
Estados Unidos
3.214188e+08
250
Uzbekistán
3.129950e+07
251
San Vicente y las Granadinas
1.094620e+05
252
Venezuela
3.110808e+07
253
Islas Vírgenes Británicas
3.011700e+04
254
Islas Vírgenes (EE.UU.)
1.035740e+05
255
Viet Nam
9.170380e+07
256
Vanuatu
2.646520e+05
257
Mundo
7.346633e+09
258
Samoa
1.932280e+05
259
Kosovo
1.797151e+06
260
Yemen, Rep. del
2.683222e+07
261
Sudáfrica
5.495692e+07
262
Zambia
1.621177e+07
263
Zimbabwe
1.560275e+07
264 rows × 2 columns
In [72]:
df.iloc[:,0:5] # Mostrar los primero 5 campos del DataFrame
Out[72]:
Country Name
Country Code
Indicator Name
Indicator Code
1960
0
Aruba
ABW
Población, total
SP.POP.TOTL
5.420800e+04
1
Afganistán
AFG
Población, total
SP.POP.TOTL
8.994793e+06
2
Angola
AGO
Población, total
SP.POP.TOTL
5.270844e+06
3
Albania
ALB
Población, total
SP.POP.TOTL
1.608800e+06
4
Andorra
AND
Población, total
SP.POP.TOTL
1.341400e+04
5
El mundo árabe
ARB
Población, total
SP.POP.TOTL
9.254053e+07
6
Emiratos Árabes Unidos
ARE
Población, total
SP.POP.TOTL
9.261200e+04
7
Argentina
ARG
Población, total
SP.POP.TOTL
2.061908e+07
8
Armenia
ARM
Población, total
SP.POP.TOTL
1.867396e+06
9
Samoa Americana
ASM
Población, total
SP.POP.TOTL
2.001200e+04
10
Antigua y Barbuda
ATG
Población, total
SP.POP.TOTL
5.468100e+04
11
Australia
AUS
Población, total
SP.POP.TOTL
1.027648e+07
12
Austria
AUT
Población, total
SP.POP.TOTL
7.047539e+06
13
Azerbaiyán
AZE
Población, total
SP.POP.TOTL
3.897889e+06
14
Burundi
BDI
Población, total
SP.POP.TOTL
2.786740e+06
15
Bélgica
BEL
Población, total
SP.POP.TOTL
9.153489e+06
16
Benin
BEN
Población, total
SP.POP.TOTL
2.431620e+06
17
Burkina Faso
BFA
Población, total
SP.POP.TOTL
4.829291e+06
18
Bangladesh
BGD
Población, total
SP.POP.TOTL
4.820070e+07
19
Bulgaria
BGR
Población, total
SP.POP.TOTL
7.867374e+06
20
Bahrein
BHR
Población, total
SP.POP.TOTL
1.625010e+05
21
Bahamas
BHS
Población, total
SP.POP.TOTL
1.095260e+05
22
Bosnia y Herzegovina
BIH
Población, total
SP.POP.TOTL
3.214520e+06
23
Belarús
BLR
Población, total
SP.POP.TOTL
8.198000e+06
24
Belice
BLZ
Población, total
SP.POP.TOTL
9.206800e+04
25
Bermudas
BMU
Población, total
SP.POP.TOTL
4.440000e+04
26
Bolivia
BOL
Población, total
SP.POP.TOTL
3.693451e+06
27
Brasil
BRA
Población, total
SP.POP.TOTL
7.249358e+07
28
Barbados
BRB
Población, total
SP.POP.TOTL
2.309340e+05
29
Brunei Darussalam
BRN
Población, total
SP.POP.TOTL
8.182500e+04
...
...
...
...
...
...
234
América Latina y el Caribe (BIRF y la AIF)
TLA
Población, total
SP.POP.TOTL
2.104957e+08
235
Timor-Leste
TLS
Población, total
SP.POP.TOTL
4.995250e+05
236
Oriente Medio y Norte de África (BIRF y la AIF)
TMN
Población, total
SP.POP.TOTL
9.791405e+07
237
Tonga
TON
Población, total
SP.POP.TOTL
6.160000e+04
238
Asia meridional (BIRF y la AIF)
TSA
Población, total
SP.POP.TOTL
5.720361e+08
239
África al sur del Sahara (BIRF y la AIF)
TSS
Población, total
SP.POP.TOTL
2.282688e+08
240
Trinidad y Tobago
TTO
Población, total
SP.POP.TOTL
8.484810e+05
241
Túnez
TUN
Población, total
SP.POP.TOTL
4.220701e+06
242
Turquía
TUR
Población, total
SP.POP.TOTL
2.755328e+07
243
Tuvalu
TUV
Población, total
SP.POP.TOTL
6.104000e+03
244
Tanzanía
TZA
Población, total
SP.POP.TOTL
1.007449e+07
245
Uganda
UGA
Población, total
SP.POP.TOTL
6.788211e+06
246
Ucrania
UKR
Población, total
SP.POP.TOTL
4.266215e+07
247
Ingreso mediano alto
UMC
Población, total
SP.POP.TOTL
1.175211e+09
248
Uruguay
URY
Población, total
SP.POP.TOTL
2.538651e+06
249
Estados Unidos
USA
Población, total
SP.POP.TOTL
1.806710e+08
250
Uzbekistán
UZB
Población, total
SP.POP.TOTL
8.789492e+06
251
San Vicente y las Granadinas
VCT
Población, total
SP.POP.TOTL
8.094800e+04
252
Venezuela
VEN
Población, total
SP.POP.TOTL
8.146845e+06
253
Islas Vírgenes Británicas
VGB
Población, total
SP.POP.TOTL
8.036000e+03
254
Islas Vírgenes (EE.UU.)
VIR
Población, total
SP.POP.TOTL
3.200000e+04
255
Viet Nam
VNM
Población, total
SP.POP.TOTL
3.474300e+07
256
Vanuatu
VUT
Población, total
SP.POP.TOTL
6.370100e+04
257
Mundo
WLD
Población, total
SP.POP.TOTL
3.035056e+09
258
Samoa
WSM
Población, total
SP.POP.TOTL
1.086450e+05
259
Kosovo
XKX
Población, total
SP.POP.TOTL
9.470000e+05
260
Yemen, Rep. del
YEM
Población, total
SP.POP.TOTL
5.166311e+06
261
Sudáfrica
ZAF
Población, total
SP.POP.TOTL
1.739600e+07
262
Zambia
ZMB
Población, total
SP.POP.TOTL
3.049586e+06
263
Zimbabwe
ZWE
Población, total
SP.POP.TOTL
3.752390e+06
264 rows × 5 columns
In [73]:
df[df['Country Name']=='República Dominicana'] #Visualizar una nación
Out[73]:
Country Name
Country Code
Indicator Name
Indicator Code
1960
1961
1962
1963
1964
1965
...
2008
2009
2010
2011
2012
2013
2014
2015
2016
Unnamed: 61
57
República Dominicana
DOM
Población, total
SP.POP.TOTL
3294039.0
3406299.0
3521276.0
3638628.0
3757962.0
3878952.0
...
9636491.0
9767737.0
9897983.0
10027140.0
10155036.0
10281408.0
10405943.0
10528391.0
NaN
NaN
1 rows × 62 columns
In [74]:
# Cambiando indice en un dataframe
df.index = df['Country Code']
df.index.name = 'Codigo País'
In [75]:
df.info()
<class 'pandas.core.frame.DataFrame'>
Index: 264 entries, ABW to ZWE
Data columns (total 62 columns):
Country Name 264 non-null object
Country Code 264 non-null object
Indicator Name 264 non-null object
Indicator Code 264 non-null object
1960 260 non-null float64
1961 260 non-null float64
1962 260 non-null float64
1963 260 non-null float64
1964 260 non-null float64
1965 260 non-null float64
1966 260 non-null float64
1967 260 non-null float64
1968 260 non-null float64
1969 260 non-null float64
1970 260 non-null float64
1971 260 non-null float64
1972 260 non-null float64
1973 260 non-null float64
1974 260 non-null float64
1975 260 non-null float64
1976 260 non-null float64
1977 260 non-null float64
1978 260 non-null float64
1979 260 non-null float64
1980 260 non-null float64
1981 260 non-null float64
1982 260 non-null float64
1983 260 non-null float64
1984 260 non-null float64
1985 260 non-null float64
1986 260 non-null float64
1987 260 non-null float64
1988 260 non-null float64
1989 260 non-null float64
1990 262 non-null float64
1991 262 non-null float64
1992 261 non-null float64
1993 261 non-null float64
1994 261 non-null float64
1995 262 non-null float64
1996 262 non-null float64
1997 262 non-null float64
1998 263 non-null float64
1999 263 non-null float64
2000 263 non-null float64
2001 263 non-null float64
2002 263 non-null float64
2003 263 non-null float64
2004 263 non-null float64
2005 263 non-null float64
2006 263 non-null float64
2007 263 non-null float64
2008 263 non-null float64
2009 263 non-null float64
2010 263 non-null float64
2011 263 non-null float64
2012 262 non-null float64
2013 262 non-null float64
2014 262 non-null float64
2015 262 non-null float64
2016 0 non-null float64
Unnamed: 61 0 non-null float64
dtypes: float64(58), object(4)
memory usage: 129.9+ KB
In [76]:
df
Out[76]:
Country Name
Country Code
Indicator Name
Indicator Code
1960
1961
1962
1963
1964
1965
...
2008
2009
2010
2011
2012
2013
2014
2015
2016
Unnamed: 61
Codigo País
ABW
Aruba
ABW
Población, total
SP.POP.TOTL
5.420800e+04
5.543500e+04
5.622600e+04
5.669700e+04
5.702900e+04
5.736000e+04
...
1.013420e+05
1.014160e+05
1.015970e+05
1.019360e+05
1.023930e+05
1.029210e+05
1.034410e+05
1.038890e+05
NaN
NaN
AFG
Afganistán
AFG
Población, total
SP.POP.TOTL
8.994793e+06
9.164945e+06
9.343772e+06
9.531555e+06
9.728645e+06
9.935358e+06
...
2.652874e+07
2.720729e+07
2.796221e+07
2.880917e+07
2.972680e+07
3.068250e+07
3.162751e+07
3.252656e+07
NaN
NaN
AGO
Angola
AGO
Población, total
SP.POP.TOTL
5.270844e+06
5.367287e+06
5.465905e+06
5.565808e+06
5.665701e+06
5.765025e+06
...
1.984225e+07
2.052010e+07
2.121995e+07
2.194230e+07
2.268563e+07
2.344820e+07
2.422752e+07
2.502197e+07
NaN
NaN
ALB
Albania
ALB
Población, total
SP.POP.TOTL
1.608800e+06
1.659800e+06
1.711319e+06
1.762621e+06
1.814135e+06
1.864791e+06
...
2.947314e+06
2.927519e+06
2.913021e+06
2.904780e+06
2.900247e+06
2.896652e+06
2.893654e+06
2.889167e+06
NaN
NaN
AND
Andorra
AND
Población, total
SP.POP.TOTL
1.341400e+04
1.437600e+04
1.537600e+04
1.641000e+04
1.747000e+04
1.855100e+04
...
8.561600e+04
8.547400e+04
8.441900e+04
8.232600e+04
7.931600e+04
7.590200e+04
7.278600e+04
7.047300e+04
NaN
NaN
ARB
El mundo árabe
ARB
Población, total
SP.POP.TOTL
9.254053e+07
9.507799e+07
9.771119e+07
1.004394e+08
1.032637e+08
1.061841e+08
...
3.368865e+08
3.450542e+08
3.531122e+08
3.610318e+08
3.688026e+08
3.765043e+08
3.842226e+08
3.920223e+08
NaN
NaN
ARE
Emiratos Árabes Unidos
ARE
Población, total
SP.POP.TOTL
9.261200e+04
1.009850e+05
1.122400e+05
1.252160e+05
1.382200e+05
1.503180e+05
...
6.900142e+06
7.705423e+06
8.329453e+06
8.734722e+06
8.952542e+06
9.039978e+06
9.086139e+06
9.156963e+06
NaN
NaN
ARG
Argentina
ARG
Población, total
SP.POP.TOTL
2.061908e+07
2.095308e+07
2.128768e+07
2.162184e+07
2.195393e+07
2.228339e+07
...
4.038186e+07
4.079864e+07
4.122288e+07
4.165562e+07
4.209522e+07
4.253830e+07
4.298003e+07
4.341676e+07
NaN
NaN
ARM
Armenia
ARM
Población, total
SP.POP.TOTL
1.867396e+06
1.934239e+06
2.002170e+06
2.070427e+06
2.138133e+06
2.204650e+06
...
2.975029e+06
2.966108e+06
2.963496e+06
2.967984e+06
2.978339e+06
2.992192e+06
3.006154e+06
3.017712e+06
NaN
NaN
ASM
Samoa Americana
ASM
Población, total
SP.POP.TOTL
2.001200e+04
2.047800e+04
2.111800e+04
2.188300e+04
2.270100e+04
2.351800e+04
...
5.703100e+04
5.622600e+04
5.563600e+04
5.531600e+04
5.522700e+04
5.530200e+04
5.543400e+04
5.553800e+04
NaN
NaN
ATG
Antigua y Barbuda
ATG
Población, total
SP.POP.TOTL
5.468100e+04
5.540300e+04
5.631100e+04
5.736800e+04
5.850000e+04
5.965300e+04
...
8.535000e+04
8.630000e+04
8.723300e+04
8.815200e+04
8.906900e+04
8.998500e+04
9.090000e+04
9.181800e+04
NaN
NaN
AUS
Australia
AUS
Población, total
SP.POP.TOTL
1.027648e+07
1.048300e+07
1.074200e+07
1.095000e+07
1.116700e+07
1.138800e+07
...
2.124920e+07
2.169170e+07
2.203175e+07
2.234002e+07
2.272825e+07
2.311735e+07
2.346409e+07
2.378117e+07
NaN
NaN
AUT
Austria
AUT
Población, total
SP.POP.TOTL
7.047539e+06
7.086299e+06
7.129864e+06
7.175811e+06
7.223801e+06
7.270889e+06
...
8.321496e+06
8.343323e+06
8.363404e+06
8.391643e+06
8.429991e+06
8.479375e+06
8.541575e+06
8.611088e+06
NaN
NaN
AZE
Azerbaiyán
AZE
Población, total
SP.POP.TOTL
3.897889e+06
4.030130e+06
4.167558e+06
4.307315e+06
4.445653e+06
4.579759e+06
...
8.763400e+06
8.947243e+06
9.054332e+06
9.173082e+06
9.295784e+06
9.416801e+06
9.535079e+06
9.651349e+06
NaN
NaN
BDI
Burundi
BDI
Población, total
SP.POP.TOTL
2.786740e+06
2.840375e+06
2.894510e+06
2.950903e+06
3.011957e+06
3.079034e+06
...
8.821795e+06
9.137786e+06
9.461117e+06
9.790151e+06
1.012457e+07
1.046596e+07
1.081686e+07
1.117892e+07
NaN
NaN
BEL
Bélgica
BEL
Población, total
SP.POP.TOTL
9.153489e+06
9.183948e+06
9.220578e+06
9.289770e+06
9.378113e+06
9.463667e+06
...
1.070997e+07
1.079649e+07
1.089559e+07
1.104774e+07
1.112825e+07
1.118282e+07
1.123121e+07
1.128572e+07
NaN
NaN
BEN
Benin
BEN
Población, total
SP.POP.TOTL
2.431620e+06
2.466002e+06
2.503232e+06
2.543335e+06
2.586362e+06
2.632360e+06
...
8.973525e+06
9.240982e+06
9.509798e+06
9.779391e+06
1.004979e+07
1.032223e+07
1.059848e+07
1.087983e+07
NaN
NaN
BFA
Burkina Faso
BFA
Población, total
SP.POP.TOTL
4.829291e+06
4.894578e+06
4.960325e+06
5.027818e+06
5.098892e+06
5.174869e+06
...
1.470901e+07
1.516586e+07
1.563207e+07
1.610685e+07
1.659081e+07
1.708455e+07
1.758920e+07
1.810557e+07
NaN
NaN
BGD
Bangladesh
BGD
Población, total
SP.POP.TOTL
4.820070e+07
4.959361e+07
5.103060e+07
5.253260e+07
5.412939e+07
5.583502e+07
...
1.482525e+08
1.499058e+08
1.516168e+08
1.534056e+08
1.552574e+08
1.571574e+08
1.590775e+08
1.609956e+08
NaN
NaN
BGR
Bulgaria
BGR
Población, total
SP.POP.TOTL
7.867374e+06
7.943118e+06
8.012946e+06
8.078145e+06
8.144340e+06
8.204168e+06
...
7.492561e+06
7.444443e+06
7.395599e+06
7.348328e+06
7.305888e+06
7.265115e+06
7.223938e+06
7.177991e+06
NaN
NaN
BHR
Bahrein
BHR
Población, total
SP.POP.TOTL
1.625010e+05
1.679240e+05
1.731070e+05
1.780480e+05
1.827740e+05
1.873480e+05
...
1.115777e+06
1.196774e+06
1.261319e+06
1.306014e+06
1.333577e+06
1.349427e+06
1.361930e+06
1.377237e+06
NaN
NaN
BHS
Bahamas
BHS
Población, total
SP.POP.TOTL
1.095260e+05
1.151080e+05
1.210830e+05
1.273310e+05
1.336970e+05
1.400490e+05
...
3.485870e+05
3.547800e+05
3.608300e+05
3.667110e+05
3.723880e+05
3.778410e+05
3.830540e+05
3.880190e+05
NaN
NaN
BIH
Bosnia y Herzegovina
BIH
Población, total
SP.POP.TOTL
3.214520e+06
3.277096e+06
3.341809e+06
3.406466e+06
3.468083e+06
3.524596e+06
...
3.839749e+06
3.837732e+06
3.835258e+06
3.832310e+06
3.828419e+06
3.823533e+06
3.817554e+06
3.810416e+06
NaN
NaN
BLR
Belarús
BLR
Población, total
SP.POP.TOTL
8.198000e+06
8.271216e+06
8.351928e+06
8.437232e+06
8.524224e+06
8.610000e+06
...
9.528000e+06
9.507000e+06
9.490000e+06
9.473000e+06
9.464000e+06
9.466000e+06
9.483000e+06
9.513000e+06
NaN
NaN
BLZ
Belice
BLZ
Población, total
SP.POP.TOTL
9.206800e+04
9.470100e+04
9.738900e+04
1.001660e+05
1.030700e+05
1.061210e+05
...
3.061650e+05
3.139250e+05
3.216090e+05
3.291930e+05
3.367070e+05
3.441930e+05
3.517060e+05
3.592870e+05
NaN
NaN
BMU
Bermudas
BMU
Población, total
SP.POP.TOTL
4.440000e+04
4.550000e+04
4.660000e+04
4.770000e+04
4.890000e+04
5.010000e+04
...
6.527300e+04
6.563600e+04
6.512400e+04
6.456400e+04
6.479800e+04
6.500100e+04
6.513900e+04
6.523500e+04
NaN
NaN
BOL
Bolivia
BOL
Población, total
SP.POP.TOTL
3.693451e+06
3.764815e+06
3.838096e+06
3.913397e+06
3.990855e+06
4.070590e+06
...
9.599916e+06
9.758799e+06
9.918245e+06
1.007824e+07
1.023876e+07
1.039993e+07
1.056189e+07
1.072470e+07
NaN
NaN
BRA
Brasil
BRA
Población, total
SP.POP.TOTL
7.249358e+07
7.470689e+07
7.700755e+07
7.936845e+07
8.175180e+07
8.413006e+07
...
1.947697e+08
1.967013e+08
1.986142e+08
2.005176e+08
2.024016e+08
2.042594e+08
2.060779e+08
2.078475e+08
NaN
NaN
BRB
Barbados
BRB
Población, total
SP.POP.TOTL
2.309340e+05
2.316740e+05
2.325840e+05
2.335870e+05
2.345470e+05
2.353730e+05
...
2.773150e+05
2.784660e+05
2.795660e+05
2.806020e+05
2.815800e+05
2.825030e+05
2.833800e+05
2.842150e+05
NaN
NaN
BRN
Brunei Darussalam
BRN
Población, total
SP.POP.TOTL
8.182500e+04
8.568700e+04
8.960300e+04
9.365000e+04
9.793300e+04
1.025250e+05
...
3.807860e+05
3.870800e+05
3.933020e+05
3.994430e+05
4.055120e+05
4.114990e+05
4.173940e+05
4.231880e+05
NaN
NaN
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
TLA
América Latina y el Caribe (BIRF y la AIF)
TLA
Población, total
SP.POP.TOTL
2.104957e+08
2.164941e+08
2.226894e+08
2.290425e+08
2.354987e+08
2.420184e+08
...
5.682523e+08
5.753981e+08
5.824841e+08
5.895062e+08
5.964635e+08
6.033477e+08
6.101499e+08
6.168626e+08
NaN
NaN
TLS
Timor-Leste
TLS
Población, total
SP.POP.TOTL
4.995250e+05
5.083110e+05
5.174460e+05
5.269360e+05
5.367980e+05
5.470350e+05
...
1.030630e+06
1.048367e+06
1.066409e+06
1.120392e+06
1.148958e+06
1.180069e+06
1.212107e+06
1.245015e+06
NaN
NaN
TMN
Oriente Medio y Norte de África (BIRF y la AIF)
TMN
Población, total
SP.POP.TOTL
9.791405e+07
1.005201e+08
1.032034e+08
1.059679e+08
1.088222e+08
1.117711e+08
...
3.166325e+08
3.223389e+08
3.281177e+08
3.339812e+08
3.398933e+08
3.458872e+08
3.519682e+08
3.581388e+08
NaN
NaN
TON
Tonga
TON
Población, total
SP.POP.TOTL
6.160000e+04
6.374000e+04
6.625500e+04
6.900000e+04
7.175700e+04
7.436300e+04
...
1.028160e+05
1.034160e+05
1.039470e+05
1.043920e+05
1.047690e+05
1.051390e+05
1.055860e+05
1.061700e+05
NaN
NaN
TSA
Asia meridional (BIRF y la AIF)
TSA
Población, total
SP.POP.TOTL
5.720361e+08
5.841432e+08
5.967011e+08
6.095715e+08
6.230731e+08
6.369638e+08
...
1.582147e+09
1.605444e+09
1.628689e+09
1.651889e+09
1.675019e+09
1.698093e+09
1.721153e+09
1.744161e+09
NaN
NaN
TSS
África al sur del Sahara (BIRF y la AIF)
TSS
Población, total
SP.POP.TOTL
2.282688e+08
2.337600e+08
2.394036e+08
2.452170e+08
2.512159e+08
2.574149e+08
...
8.272397e+08
8.501903e+08
8.737802e+08
8.979985e+08
9.228551e+08
9.483224e+08
9.743719e+08
1.000981e+09
NaN
NaN
TTO
Trinidad y Tobago
TTO
Población, total
SP.POP.TOTL
8.484810e+05
8.653560e+05
8.800190e+05
8.925710e+05
9.032720e+05
9.124190e+05
...
1.315372e+06
1.321624e+06
1.328095e+06
1.334790e+06
1.341579e+06
1.348240e+06
1.354483e+06
1.360088e+06
NaN
NaN
TUN
Túnez
TUN
Población, total
SP.POP.TOTL
4.220701e+06
4.277371e+06
4.350811e+06
4.436643e+06
4.530835e+06
4.630000e+06
...
1.032890e+07
1.043960e+07
1.054710e+07
1.067380e+07
1.077750e+07
1.088650e+07
1.099660e+07
1.110780e+07
NaN
NaN
TUR
Turquía
TUR
Población, total
SP.POP.TOTL
2.755328e+07
2.822929e+07
2.890998e+07
2.959705e+07
3.029297e+07
3.100017e+07
...
7.034436e+07
7.126131e+07
7.231042e+07
7.351700e+07
7.484919e+07
7.622364e+07
7.752379e+07
7.866583e+07
NaN
NaN
TUV
Tuvalu
TUV
Población, total
SP.POP.TOTL
6.104000e+03
6.242000e+03
6.391000e+03
6.542000e+03
6.687000e+03
6.819000e+03
...
9.788000e+03
9.808000e+03
9.827000e+03
9.844000e+03
9.860000e+03
9.876000e+03
9.893000e+03
9.916000e+03
NaN
NaN
TZA
Tanzanía
TZA
Población, total
SP.POP.TOTL
1.007449e+07
1.037338e+07
1.068389e+07
1.100588e+07
1.133908e+07
1.168351e+07
...
4.284474e+07
4.422211e+07
4.564852e+07
4.712300e+07
4.864571e+07
5.021346e+07
5.182262e+07
5.347042e+07
NaN
NaN
UGA
Uganda
UGA
Población, total
SP.POP.TOTL
6.788211e+06
7.006629e+06
7.240155e+06
7.487411e+06
7.746181e+06
8.014376e+06
...
3.101443e+07
3.206712e+07
3.314942e+07
3.426034e+07
3.540062e+07
3.657339e+07
3.778297e+07
3.903238e+07
NaN
NaN
UKR
Ucrania
UKR
Población, total
SP.POP.TOTL
4.266215e+07
4.320364e+07
4.374947e+07
4.428590e+07
4.479432e+07
4.526194e+07
...
4.625820e+07
4.605330e+07
4.587070e+07
4.570610e+07
4.559330e+07
4.548960e+07
4.536290e+07
4.519820e+07
NaN
NaN
UMC
Ingreso mediano alto
UMC
Población, total
SP.POP.TOTL
1.175211e+09
1.180098e+09
1.197381e+09
1.225994e+09
1.254220e+09
1.283353e+09
...
2.455687e+09
2.474451e+09
2.493277e+09
2.512627e+09
2.532681e+09
2.553112e+09
2.573612e+09
2.593743e+09
NaN
NaN
URY
Uruguay
URY
Población, total
SP.POP.TOTL
2.538651e+06
2.571691e+06
2.603887e+06
2.635128e+06
2.665387e+06
2.694535e+06
...
3.350832e+06
3.362761e+06
3.374414e+06
3.385610e+06
3.396753e+06
3.407969e+06
3.419516e+06
3.431555e+06
NaN
NaN
USA
Estados Unidos
USA
Población, total
SP.POP.TOTL
1.806710e+08
1.836910e+08
1.865380e+08
1.892420e+08
1.918890e+08
1.943030e+08
...
3.040940e+08
3.067715e+08
3.093469e+08
3.117189e+08
3.141026e+08
3.164274e+08
3.189074e+08
3.214188e+08
NaN
NaN
UZB
Uzbekistán
UZB
Población, total
SP.POP.TOTL
8.789492e+06
9.044671e+06
9.319510e+06
9.611601e+06
9.917202e+06
1.023350e+07
...
2.730280e+07
2.776740e+07
2.856240e+07
2.933940e+07
2.977450e+07
3.024320e+07
3.075770e+07
3.129950e+07
NaN
NaN
VCT
San Vicente y las Granadinas
VCT
Población, total
SP.POP.TOTL
8.094800e+04
8.214400e+04
8.320600e+04
8.416700e+04
8.507600e+04
8.597200e+04
...
1.091650e+05
1.092550e+05
1.093160e+05
1.093410e+05
1.093340e+05
1.093270e+05
1.093600e+05
1.094620e+05
NaN
NaN
VEN
Venezuela
VEN
Población, total
SP.POP.TOTL
8.146845e+06
8.461684e+06
8.790590e+06
9.130346e+06
9.476255e+06
9.824694e+06
...
2.811672e+07
2.855861e+07
2.899574e+07
2.942763e+07
2.985424e+07
3.027604e+07
3.069383e+07
3.110808e+07
NaN
NaN
VGB
Islas Vírgenes Británicas
VGB
Población, total
SP.POP.TOTL
8.036000e+03
8.157000e+03
8.298000e+03
8.455000e+03
8.628000e+03
8.813000e+03
...
2.560400e+04
2.645000e+04
2.722300e+04
2.790600e+04
2.851100e+04
2.905800e+04
2.958500e+04
3.011700e+04
NaN
NaN
VIR
Islas Vírgenes (EE.UU.)
VIR
Población, total
SP.POP.TOTL
3.200000e+04
3.410000e+04
3.630000e+04
3.870000e+04
4.130000e+04
4.400000e+04
...
1.070910e+05
1.067070e+05
1.062670e+05
1.057840e+05
1.052750e+05
1.047370e+05
1.041700e+05
1.035740e+05
NaN
NaN
VNM
Viet Nam
VNM
Población, total
SP.POP.TOTL
3.474300e+07
3.542800e+07
3.612300e+07
3.683600e+07
3.757400e+07
3.834100e+07
...
8.511870e+07
8.602500e+07
8.693250e+07
8.786030e+07
8.880920e+07
8.975950e+07
9.072890e+07
9.170380e+07
NaN
NaN
VUT
Vanuatu
VUT
Población, total
SP.POP.TOTL
6.370100e+04
6.570800e+04
6.780600e+04
6.996200e+04
7.213100e+04
7.428700e+04
...
2.253350e+05
2.307820e+05
2.362990e+05
2.418760e+05
2.474980e+05
2.531650e+05
2.588830e+05
2.646520e+05
NaN
NaN
WLD
Mundo
WLD
Población, total
SP.POP.TOTL
3.035056e+09
3.076121e+09
3.129064e+09
3.193947e+09
3.259355e+09
3.326054e+09
...
6.758303e+09
6.840956e+09
6.923684e+09
7.006908e+09
7.089452e+09
7.176092e+09
7.260780e+09
7.346633e+09
NaN
NaN
WSM
Samoa
WSM
Población, total
SP.POP.TOTL
1.086450e+05
1.121210e+05
1.157860e+05
1.195640e+05
1.233540e+05
1.270680e+05
...
1.834400e+05
1.847000e+05
1.860290e+05
1.874340e+05
1.889010e+05
1.903900e+05
1.918450e+05
1.932280e+05
NaN
NaN
XKX
Kosovo
XKX
Población, total
SP.POP.TOTL
9.470000e+05
9.660000e+05
9.940000e+05
1.022000e+06
1.050000e+06
1.078000e+06
...
1.747383e+06
1.761474e+06
1.775680e+06
1.790957e+06
1.805200e+06
1.818117e+06
1.812771e+06
1.797151e+06
NaN
NaN
YEM
Yemen, Rep. del
YEM
Población, total
SP.POP.TOTL
5.166311e+06
5.251663e+06
5.339285e+06
5.429501e+06
5.522690e+06
5.619170e+06
...
2.232270e+07
2.295423e+07
2.359197e+07
2.423494e+07
2.488279e+07
2.553322e+07
2.618368e+07
2.683222e+07
NaN
NaN
ZAF
Sudáfrica
ZAF
Población, total
SP.POP.TOTL
1.739600e+07
1.794996e+07
1.845944e+07
1.893614e+07
1.939055e+07
1.983200e+07
...
4.929622e+07
5.002092e+07
5.077183e+07
5.154996e+07
5.235638e+07
5.319222e+07
5.405865e+07
5.495692e+07
NaN
NaN
ZMB
Zambia
ZMB
Población, total
SP.POP.TOTL
3.049586e+06
3.142848e+06
3.240664e+06
3.342894e+06
3.449266e+06
3.559687e+06
...
1.311458e+07
1.350785e+07
1.391744e+07
1.434353e+07
1.478658e+07
1.524609e+07
1.572134e+07
1.621177e+07
NaN
NaN
ZWE
Zimbabwe
ZWE
Población, total
SP.POP.TOTL
3.752390e+06
3.876638e+06
4.006262e+06
4.140804e+06
4.279561e+06
4.422132e+06
...
1.349546e+07
1.372100e+07
1.397390e+07
1.425559e+07
1.456548e+07
1.489809e+07
1.524586e+07
1.560275e+07
NaN
NaN
264 rows × 62 columns
In [77]:
dfiltrado = df[df['2015']>9000000]
In [78]:
dfiltrado.info()
<class 'pandas.core.frame.DataFrame'>
Index: 136 entries, AFG to ZWE
Data columns (total 62 columns):
Country Name 136 non-null object
Country Code 136 non-null object
Indicator Name 136 non-null object
Indicator Code 136 non-null object
1960 136 non-null float64
1961 136 non-null float64
1962 136 non-null float64
1963 136 non-null float64
1964 136 non-null float64
1965 136 non-null float64
1966 136 non-null float64
1967 136 non-null float64
1968 136 non-null float64
1969 136 non-null float64
1970 136 non-null float64
1971 136 non-null float64
1972 136 non-null float64
1973 136 non-null float64
1974 136 non-null float64
1975 136 non-null float64
1976 136 non-null float64
1977 136 non-null float64
1978 136 non-null float64
1979 136 non-null float64
1980 136 non-null float64
1981 136 non-null float64
1982 136 non-null float64
1983 136 non-null float64
1984 136 non-null float64
1985 136 non-null float64
1986 136 non-null float64
1987 136 non-null float64
1988 136 non-null float64
1989 136 non-null float64
1990 136 non-null float64
1991 136 non-null float64
1992 136 non-null float64
1993 136 non-null float64
1994 136 non-null float64
1995 136 non-null float64
1996 136 non-null float64
1997 136 non-null float64
1998 136 non-null float64
1999 136 non-null float64
2000 136 non-null float64
2001 136 non-null float64
2002 136 non-null float64
2003 136 non-null float64
2004 136 non-null float64
2005 136 non-null float64
2006 136 non-null float64
2007 136 non-null float64
2008 136 non-null float64
2009 136 non-null float64
2010 136 non-null float64
2011 136 non-null float64
2012 136 non-null float64
2013 136 non-null float64
2014 136 non-null float64
2015 136 non-null float64
2016 0 non-null float64
Unnamed: 61 0 non-null float64
dtypes: float64(58), object(4)
memory usage: 66.9+ KB
In [79]:
#Exportar archivo df.to<TAB> podra ver la gama de opciones para exportación de ficheros
ficherosalida = 'ficheroexcelsalida.xlsx'
dfiltrado.to_excel(ficherosalida)
Content source: JoseMambruDO/DataPortfolio
Similar notebooks: