Skip to content

Instantly share code, notes, and snippets.

@togakangaroo
Created April 20, 2020 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save togakangaroo/12317c0835f2154b12e6edd54aaf380e to your computer and use it in GitHub Desktop.
Save togakangaroo/12317c0835f2154b12e6edd54aaf380e to your computer and use it in GitHub Desktop.

Covid19 County-Level Deaths

Set this variable to your county name

"Orleans"

No need to run this block, its just pulling data from the nytimes covid-19 tracking csv and filtering it to that of your county. If you’re not in Louisiana, change it to your state.

curl https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv | 
 grep "$COUNTY,.*Louisiana"

Show the daily infections, deaths, and change in deaths from the above.

deaths_per_day = [x[-1] for x in data]
data_with_deltas = [(a[0], a[1], a[-2], a[-1], b - a[-1]) for a, b in zip(data, deaths_per_day[1:])]
return data_with_deltas

Chart out the above along with a five day window average which shows the curve better with small numbers

change-in-deaths-per-day-Orleans.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment