/covid-19-visualization

Notebooks to generate visualizations of COVID-19 data from JHU CSSE

Primary LanguageJupyter Notebook

COVID-19 Data Visualizations ๐Ÿ“ˆ๐Ÿ“Š๐Ÿ“‰

Set of data visualizations for COVID-19 data from Johns Hopkins CSSE department. Charts of time series trends are inspired by the plot from this article in the Financial Times, graphics by John Burn-Murdoch.

The file covid_visualization.ipynb contains a set of functions for extracting key pieces of data from the JHU dataset. Feel free to use or adapt these functions for your specific use case:

Functions

covidData(country, output=1, start=100)

Extracts time series data of interest for a specific country

country โ€“ string with country name of interest
output โ€“ type of output (1 for confirmed cases, 2 for recovered cases, 3 for deaths, 4 for net (open) cases โ€“ default 1)
start โ€“ number of cases after which to report data (e.g. starting after the nth case โ€“ default 100)

 

doubling_rate(country, output=1)

Returns the projected doubling rate as well as the most recent doubling event

The growth rate (r) is calculated from the difference in cases between the most recent data point and two days prior:

xn = xn โ€“ 2 ยท (1 + r)2

From the value of r, the projected number of days for doubling (n) can be calculated:

(1 + r)n = 2

country โ€“ string with country name of interest
output โ€“ type of output (1 for confirmed cases, 2 for recovered cases, and 3 for deaths โ€“ default 1)