Tried importing data from web-world bank and got an error

194 views Asked by At

Code---- from pandas.io.wb import download

YEAR = 2013

GDP_INDICATOR = 'NY.GDP.MKTP.CD'

data = download(indicator=GDP_INDICATOR, country='all',

          start=YEAR, end=YEAR)

data.head()

Error message---

ModuleNotFoundError Traceback (most recent call last) C:\Users\LENOVO~1\AppData\Local\Temp/ipykernel_11260/1827974983.py in ----> 1 from pandas.io.wb import download 2 3 YEAR = 2013 4 5 GDP_INDICATOR = 'NY.GDP.MKTP.CD'

ModuleNotFoundError: No module named 'pandas.io.wb'

1

There are 1 answers

0
Shishu Kumar Choudhary On

Same issuse i have found in one of my project and this piece of code work for me. Try it once.

pip install pandas-datareader

from pandas_datareader import wb

world_bank_indicators = ['NY.GDP.MKTP.KD.ZG', 'FP.CPI.TOTL.ZG', 
'GC.TAX.TOTL.GD.ZS', 'NE.EXP.GNFS.ZS', 'NE.IMP.GNFS.ZS']

pip install itables

from itables import init_notebook_mode
init_notebook_mode(all_interactive=True)

df = wb.download(indicator=world_bank_indicators, country=['all'], 
start=2008, end=2019)
df