Created
February 9, 2020 20:14
-
-
Save rchardptrsn/5a8849999fcd765685096c1fcd4a24ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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