Skip to content

Instantly share code, notes, and snippets.

@rchardptrsn
Last active January 28, 2020 03:25
Show Gist options
  • Save rchardptrsn/bcd059c986644fac448eb5d1411eb43a to your computer and use it in GitHub Desktop.
Save rchardptrsn/bcd059c986644fac448eb5d1411eb43a to your computer and use it in GitHub Desktop.
import zipfile36 as zipfile
import wget
import os
print('Beginning file download with wget module')
url = 'http://api.worldbank.org/v2/en/indicator/NY.GDP.MKTP.CD?downloadformat=csv'
wget.download(url, 'gdp data.zip')
with zipfile.ZipFile('gdp data.zip', "r") as z:
z.extractall("")
gdp = pd.read_csv('API_NY.GDP.MKTP.CD_DS2_en_csv_v2_713242.csv',skiprows=4)
gdp.head(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment