Skip to content

Instantly share code, notes, and snippets.

@massie
Created April 26, 2020 14:49
Show Gist options
  • Save massie/378eb305ab68602c6ac3907f38f02418 to your computer and use it in GitHub Desktop.
Save massie/378eb305ab68602c6ac3907f38f02418 to your computer and use it in GitHub Desktop.
Code for pulling in CA Data from CHHS Open Data
url = 'https://data.chhs.ca.gov/dataset/6882c390-b2d7-4b9a-aefa-2068cee63e47/resource/6cd8d424-dfaa-4bdd-9410-a3d656e1176e/download/covid19data.csv'
states = pd.read_csv(url,
header=0,
names=["state", "date","positive"],
usecols=['date', 'state', 'positive'],
parse_dates=['date'],
index_col=['state', 'date'],
squeeze=True).sort_index()
# You'll also need to set cutoff = 1 for calls to prepare_cases and catch empty sequences
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment