Skip to content

Instantly share code, notes, and snippets.

@shanealynn
Last active November 10, 2020 01:31
Show Gist options
  • Save shanealynn/3324456b1a22eae86fce40bdd744f102 to your computer and use it in GitHub Desktop.
Save shanealynn/3324456b1a22eae86fce40bdd744f102 to your computer and use it in GitHub Desktop.
Pandas Index Tutorial - loading data
import pandas as pd
import random
# read the data from the downloaded CSV file.
data = pd.read_csv('https://s3-eu-west-1.amazonaws.com/shanebucket/downloads/uk-500.csv')
# set a numeric id for use as an index for examples.
data['id'] = [random.randint(0,1000) for x in range(data.shape[0])]
data.head(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment