{ "metadata": { "name": "", "signature": "sha256:5f2f813e4f9aed61dcbe0eb1c90644185a05a33a9c43b04c225f78b0a41c2333" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "World Bank Indicators Data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook provides a brief demonstration of how to access the World Bank Indicators data using `pandas`.\n", "\n", "A wrapper for the API is provided as part of the main `pandas` distribution, as part of the [Remote Data Access](http://pandas.pydata.org/pandas-docs/stable/remote_data.html) support." ] }, { "cell_type": "code", "collapsed": false, "input": [ "#First of all we need to load in the pandas library...\n", "import pandas as pd\n", "\n", "#...and the pandas remote data access support for calls to the World Bank Indicators API\n", "from pandas.io import wb" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Searching for Indicators" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The easiest way to identify an indicator is to search for it by name using a keyword or key phrase." ] }, { "cell_type": "code", "collapsed": false, "input": [ "wb.search('fertility rate')" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", " | id | \n", "name | \n", "source | \n", "sourceNote | \n", "sourceOrganization | \n", "topics | \n", "
---|---|---|---|---|---|---|
6554 | \n", "SP.ADO.TFRT | \n", "Adolescent fertility rate (births per 1,000 wo... | \n", "World Development Indicators | \n", "Adolescent fertility rate is the number of bir... | \n", "b'United Nations Population Division, World Po... | \n", "Social Development ; Health ; Gender | \n", "
6594 | \n", "SP.DYN.TFRT.IN | \n", "Fertility rate, total (births per woman) | \n", "World Development Indicators | \n", "Total fertility rate represents the number of ... | \n", "b'(1) United Nations Population Division. Worl... | \n", "Gender ; Health | \n", "
6595 | \n", "SP.DYN.TFRT.Q1 | \n", "Total fertility rate (TFR) (births per woman)... | \n", "Health Nutrition and Population Statistics by ... | \n", "Total fertility rate (TFR): The number of chil... | \n", "b'Household Surveys (DHS, MICS)' | \n", "Health | \n", "
6596 | \n", "SP.DYN.TFRT.Q2 | \n", "Total fertility rate (TFR) (births per woman)... | \n", "Health Nutrition and Population Statistics by ... | \n", "Total fertility rate (TFR): The number of chil... | \n", "b'Household Surveys (DHS, MICS)' | \n", "Health | \n", "
6597 | \n", "SP.DYN.TFRT.Q3 | \n", "Total fertility rate (TFR) (births per woman)... | \n", "Health Nutrition and Population Statistics by ... | \n", "Total fertility rate (TFR): The number of chil... | \n", "b'Household Surveys (DHS, MICS)' | \n", "Health | \n", "
6598 | \n", "SP.DYN.TFRT.Q4 | \n", "Total fertility rate (TFR) (births per woman)... | \n", "Health Nutrition and Population Statistics by ... | \n", "Total fertility rate (TFR): The number of chil... | \n", "b'Household Surveys (DHS, MICS)' | \n", "Health | \n", "
6599 | \n", "SP.DYN.TFRT.Q5 | \n", "Total fertility rate (TFR) (births per woman)... | \n", "Health Nutrition and Population Statistics by ... | \n", "Total fertility rate (TFR): The number of chil... | \n", "b'Household Surveys (DHS, MICS)' | \n", "Health | \n", "
6602 | \n", "SP.DYN.WFRT | \n", "Wanted fertility rate (births per woman) | \n", "World Development Indicators | \n", "Wanted fertility rate is an estimate of what t... | \n", "b'Demographic and Health Surveys by ICF Intern... | \n", "Health ; Gender | \n", "
6603 | \n", "SP.DYN.WFRT.Q1 | \n", "Total wanted fertility rate (births per woman)... | \n", "Health Nutrition and Population Statistics by ... | \n", "Total wanted fertility rate: Total wanted fert... | \n", "b'Household Surveys (DHS, MICS)' | \n", "Health | \n", "
6604 | \n", "SP.DYN.WFRT.Q2 | \n", "Total wanted fertility rate (births per woman)... | \n", "Health Nutrition and Population Statistics by ... | \n", "Total wanted fertility rate: Total wanted fert... | \n", "b'Household Surveys (DHS, MICS)' | \n", "Health | \n", "
6605 | \n", "SP.DYN.WFRT.Q3 | \n", "Total wanted fertility rate (births per woman)... | \n", "Health Nutrition and Population Statistics by ... | \n", "Total wanted fertility rate: Total wanted fert... | \n", "b'Household Surveys (DHS, MICS)' | \n", "Health | \n", "
6606 | \n", "SP.DYN.WFRT.Q4 | \n", "Total wanted fertility rate (births per woman)... | \n", "Health Nutrition and Population Statistics by ... | \n", "Total wanted fertility rate: Total wanted fert... | \n", "b'Household Surveys (DHS, MICS)' | \n", "Health | \n", "
6607 | \n", "SP.DYN.WFRT.Q5 | \n", "Total wanted fertility rate (births per woman)... | \n", "Health Nutrition and Population Statistics by ... | \n", "Total wanted fertility rate: Total wanted fert... | \n", "b'Household Surveys (DHS, MICS)' | \n", "Health | \n", "
\n", " | id | \n", "name | \n", "source | \n", "sourceNote | \n", "sourceOrganization | \n", "topics | \n", "
---|---|---|---|---|---|---|
0 | \n", "1.0.HCount.1.25usd | \n", "Poverty Headcount ($1.25 a day) | \n", "LAC Equity Lab | \n", "The poverty headcount index measures the propo... | \n", "b'LAC Equity Lab tabulations of SEDLAC (CEDLAS... | \n", "Poverty | \n", "
1 | \n", "1.0.HCount.10usd | \n", "Under Middle Class ($10 a day) Headcount | \n", "LAC Equity Lab | \n", "The poverty headcount index measures the propo... | \n", "b'LAC Equity Lab tabulations of SEDLAC (CEDLAS... | \n", "Poverty | \n", "
2 | \n", "1.0.HCount.2.5usd | \n", "Poverty Headcount ($2.50 a day) | \n", "LAC Equity Lab | \n", "The poverty headcount index measures the propo... | \n", "b'LAC Equity Lab tabulations of SEDLAC (CEDLAS... | \n", "Poverty | \n", "
3 | \n", "1.0.HCount.Mid10to50 | \n", "Middle Class ($10-50 a day) Headcount | \n", "LAC Equity Lab | \n", "The poverty headcount index measures the propo... | \n", "b'LAC Equity Lab tabulations of SEDLAC (CEDLAS... | \n", "Poverty | \n", "
4 | \n", "1.0.HCount.Ofcl | \n", "Official Moderate Poverty Rate-National | \n", "LAC Equity Lab | \n", "The poverty headcount index measures the propo... | \n", "b'LAC Equity Lab tabulations of data from Nati... | \n", "Poverty | \n", "
\n", " | id | \n", "name | \n", "source | \n", "sourceNote | \n", "sourceOrganization | \n", "topics | \n", "
---|---|---|---|---|---|---|
700 | \n", "6.0.GDPpc_constant | \n", "GDP per capita, PPP (constant 2011 internation... | \n", "LAC Equity Lab | \n", "GDP per capita based on purchasing power parit... | \n", "b'NULWorld Development Indicators (World Bank)L' | \n", "Economy & Growth | \n", "
3496 | \n", "GDPPCKD | \n", "GDP per Capita, constant US$, millions | \n", "GEP Economic Prospects | \n", "GDP per capita is gross domestic product divid... | \n", "b'World Bank staff calculations based on World... | \n", "Economy & Growth | \n", "
5530 | \n", "NY.GDP.PCAP.KD | \n", "GDP per capita (constant 2005 US$) | \n", "World Development Indicators | \n", "GDP per capita is gross domestic product divid... | \n", "b'World Bank national accounts data, and OECD ... | \n", "Economy & Growth | \n", "
5532 | \n", "NY.GDP.PCAP.KN | \n", "GDP per capita (constant LCU) | \n", "World Development Indicators | \n", "GDP per capita is gross domestic product divid... | \n", "b'World Bank national accounts data, and OECD ... | \n", "Economy & Growth | \n", "
5534 | \n", "NY.GDP.PCAP.PP.KD | \n", "GDP per capita, PPP (constant 2011 internation... | \n", "World Development Indicators | \n", "GDP per capita based on purchasing power parit... | \n", "b'World Bank, International Comparison Program... | \n", "Economy & Growth | \n", "
\n", " | adminregion | \n", "capitalCity | \n", "iso3c | \n", "incomeLevel | \n", "iso2c | \n", "latitude | \n", "lendingType | \n", "longitude | \n", "name | \n", "region | \n", "
---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "\n", " | Oranjestad | \n", "ABW | \n", "High income: nonOECD | \n", "AW | \n", "12.5167 | \n", "Not classified | \n", "-70.0167 | \n", "Aruba | \n", "Latin America & Caribbean (all income levels) | \n", "
1 | \n", "South Asia | \n", "Kabul | \n", "AFG | \n", "Low income | \n", "AF | \n", "34.5228 | \n", "IDA | \n", "69.1761 | \n", "Afghanistan | \n", "South Asia | \n", "
2 | \n", "\n", " | \n", " | AFR | \n", "Aggregates | \n", "A9 | \n", "\n", " | Aggregates | \n", "\n", " | Africa | \n", "Aggregates | \n", "
3 | \n", "Sub-Saharan Africa (developing only) | \n", "Luanda | \n", "AGO | \n", "Upper middle income | \n", "AO | \n", "-8.81155 | \n", "IBRD | \n", "13.242 | \n", "Angola | \n", "Sub-Saharan Africa (all income levels) | \n", "
4 | \n", "Europe & Central Asia (developing only) | \n", "Tirane | \n", "ALB | \n", "Upper middle income | \n", "AL | \n", "41.3317 | \n", "IBRD | \n", "19.8172 | \n", "Albania | \n", "Europe & Central Asia (all income levels) | \n", "
\n", " | adminregion | \n", "capitalCity | \n", "iso3c | \n", "incomeLevel | \n", "iso2c | \n", "latitude | \n", "lendingType | \n", "longitude | \n", "name | \n", "region | \n", "
---|---|---|---|---|---|---|---|---|---|---|
3 | \n", "Sub-Saharan Africa (developing only) | \n", "Luanda | \n", "AGO | \n", "Upper middle income | \n", "AO | \n", "-8.81155 | \n", "IBRD | \n", "13.242 | \n", "Angola | \n", "Sub-Saharan Africa (all income levels) | \n", "
\n", " | \n", " | NY.GDP.PCAP.KD | \n", "
---|---|---|
country | \n", "year | \n", "\n", " |
Canada | \n", "2010 | \n", "36466.815112 | \n", "
2009 | \n", "35671.659294 | \n", "|
2008 | \n", "37088.020368 | \n", "|
Mexico | \n", "2010 | \n", "8084.629000 | \n", "
2009 | \n", "7788.271761 | \n", "|
2008 | \n", "8275.809458 | \n", "|
United States | \n", "2010 | \n", "43952.436548 | \n", "
2009 | \n", "43234.451155 | \n", "|
2008 | \n", "44872.653626 | \n", "
\n", " | \n", " | SP.DYN.TFRT.IN | \n", "NY.GDP.PCAP.KD | \n", "
---|---|---|---|
country | \n", "year | \n", "\n", " | \n", " |
United Kingdom | \n", "2010 | \n", "1.920 | \n", "37600.293399 | \n", "
2009 | \n", "1.890 | \n", "37277.481537 | \n", "|
2008 | \n", "1.910 | \n", "39608.431481 | \n", "|
United States | \n", "2010 | \n", "1.931 | \n", "43952.436548 | \n", "
2009 | \n", "2.002 | \n", "43234.451155 | \n", "|
2008 | \n", "2.072 | \n", "44872.653626 | \n", "
\n", " | \n", " | NY.GDP.PCAP.KD | \n", "
---|---|---|
country | \n", "year | \n", "\n", " |
United States | \n", "2008 | \n", "44872.653626 | \n", "
\n", " | \n", " | SP.DYN.TFRT.IN | \n", "
---|---|---|
country | \n", "year | \n", "\n", " |
Andean Region | \n", "2010 | \n", "NaN | \n", "
Arab World | \n", "2010 | \n", "3.297409 | \n", "
Caribbean small states | \n", "2010 | \n", "2.224484 | \n", "
Central Europe and the Baltics | \n", "2010 | \n", "1.445135 | \n", "
East Asia & Pacific (all income levels) | \n", "2010 | \n", "1.817921 | \n", "
East Asia & Pacific (developing only) | \n", "2010 | \n", "1.856321 | \n", "
East Asia and the Pacific (IFC classification) | \n", "2010 | \n", "NaN | \n", "
Euro area | \n", "2010 | \n", "1.573820 | \n", "
Europe & Central Asia (all income levels) | \n", "2010 | \n", "1.723861 | \n", "
Europe & Central Asia (developing only) | \n", "2010 | \n", "1.979588 | \n", "