Skip to content

Instantly share code, notes, and snippets.

@rchardptrsn
Created February 9, 2020 20:14
Show Gist options
  • Save rchardptrsn/5a8849999fcd765685096c1fcd4a24ca to your computer and use it in GitHub Desktop.
Save rchardptrsn/5a8849999fcd765685096c1fcd4a24ca to your computer and use it in GitHub Desktop.
# Download and read csv file
df = pd.read_csv('https://globaldatalab.org/assets/2019/09/SHDI%20Complete%203.0.csv',encoding='ISO-8859–1',dtype='str')
# Reset index - creates a column called 'index'
df = df.reset_index()
# Rename that new column 'id'
# Cosmos DB needs one column named 'id'.
df = df.rename(columns={'index':'id'})
# Convert the id column to a string - this is a document database.
df['id'] = df['id'].astype(str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment