Skip to content

Instantly share code, notes, and snippets.

@austinbrian
Created August 27, 2018 18:47
Show Gist options
  • Save austinbrian/88e62fd99350e0ad62d503c0b41a6aff to your computer and use it in GitHub Desktop.
Save austinbrian/88e62fd99350e0ad62d503c0b41a6aff to your computer and use it in GitHub Desktop.
Get pandas df from public github rawusercontent
import pandas as pd
import requests
from io import BytesIO
# using a 538 dataset as an example
url = 'https://raw.githubusercontent.com/fivethirtyeight/data/master/bob-ross/elements-by-episode.csv'
response = requests.get(url)
content = BytesIO(response.content)
df = pd.read_csv(content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment