# In[ ]:

data_date = (datetime.datetime(2010, 1, 1), datetime.datetime(2011, 1, 1))
wbdata.get_data("IC.BUS.EASE.XQ", country=("USA", "BRA"), data_date=data_date)


# In[ ]:

wbdata.search_indicators("gdp per capita")


# In[ ]:

wbdata.get_incomelevel()


# In[ ]:

countries = [i['id'] for i in wbdata.get_country(incomelevel="OEC", display=False)]
indicators = {"IC.BUS.EASE.XQ": "doing_business", "NY.GDP.PCAP.PP.KD": "gdppc"}
df = wbdata.get_dataframe(indicators, country=countries, convert_date=True)
df.describe()


# In[ ]:

df = df.dropna()
df.gdppc.corr(df.doing_business)
Example #2
0
 def testOneIncomeLevel(self):
     wbdata.get_incomelevel("OEC")
Example #3
0
wbdata.get_data('IC.REG.COST.PC.MA.ZS', country='TUR')[0]
wbdata.search_countries('united')  #GBR
wbdata.get_data('IC.REG.COST.PC.MA.ZS', country='GBR')

import datetime
data_date = (datetime.datetime(2010, 1, 1), datetime.datetime(2011, 1, 1))
wbdata.get_data("IC.REG.COST.PC.MA.ZS",
                country=("USA", "GBR"),
                data_date=data_date)
wbdata.search_indicators("gdp per capita")
wbdata.get_data('NY.GDP.PCAP.KD.ZG')

wbdata.get_data('NY.GDP.PCAP.KD.ZG', country='USA')
wbdata.get_data('NY.GDP.PCAP.KD.ZG', country='OED')

#income level filter
wbdata.get_incomelevel()
countries = [
    i['id'] for i in wbdata.get_country(incomelevel="HIC", display=False)
]
indicators = {
    "IC.REG.COST.PC.MA.ZS": "doing_business",
    "NY.GDP.PCAP.PP.KD": "gdppc"
}
df = wbdata.get_dataframe(indicators, country=countries, convert_date=True)

df.to_csv('econ.csv')
df.describe()

#TODO: pick some interesting variables that may have a theoretical connection, then run a regression (using any software is fine)
Example #4
0
 def testGetAllIncomeLevels(self):
     wbdata.get_incomelevel()
Example #5
0
 def testOneIncomeLevel(self):
     wbdata.get_incomelevel("OEC")
Example #6
0
 def testGetAllIncomeLevels(self):
     wbdata.get_incomelevel()
Example #7
0
wb.get_data("SE.ADT.1524.LT.FM.ZS", country="USA")

# selecting data range
date_range = datetime.datetime(2008, 1, 1), datetime.datetime(2019, 1, 1)
# SH.CON.1524.FE.ZS     Condom use, population ages 15-24, female (% of females ages 15-24)
# SH.CON.1524.MA.ZS     Condom use, population ages 15-24, male (% of males ages 15-24)
wb.get_data("SH.CON.1524.MA.ZS",
            country=["USA", "GBR", "NGA"],
            data_date=date_range)

# search for indicator of interest
wb.search_indicators("gdp per capita")
wb.search_indicators("condom use")

# get income level classes
wb.get_incomelevel()

# let get the data in pandas
countries = [i['id'] for i in wb.get_country(incomelevel='HIC')]

indicators = {"IC.BUS.EASE.XQ": "doing_business", "NY.GDP.PCAP.PP.KD": "gdppc"}

df = wb.get_dataframe(indicators,
                      country=countries,
                      convert_date=True,
                      data_date=date_range)

# do exploratory data analysis
df.groupby('country').describe()
df.groupby("country").describe()['gdppc']['mean'].reset_index().sort_values(
    by='mean', ascending=False)
Example #8
0
 def get_incomelevel(self):
     return wb.get_incomelevel()