COVID-19 by the numbers
Original idea for this Notebook came from https://towardsdatascience.com/analyzing-coronavirus-covid-19-data-using-pandas-and-plotly-2e34fe2c4edc. I made several modifications, changed contries and customized my own plots. It's been my go-to personal dashboard to track COVID progression. Depending on the news and current trends, I modify the countries I'm looking at.
The last chart, displaying new confirmed cases of COVID-19 in the past week vs. the total confirmed cases to date was heavily inspired by work done at https://aatishb.com/covidtrends/. When plotted in this way, exponential growth is represented as a straight line that slopes upwards. Notice that almost all countries follow a very similar path of exponential growth.
Intro
First we must download the csvs from CCSE at John Hopkins. From this download, we get:
- Dates (as columns)
- Total Confirmed Cases
- Province
- Countries
- Latitude and Longitude
Step 1 - cleanup
We use the pandas melt function to reshape the dates in one column and we setup indices on dates and countries. The datsets are now cleaner and much easier to plot.
Step 2 - Organize
We create a consolidated dataset that combines the datasets for Cases, Deaths and Recoveries. We also created a function to get daily count from the cumulative data. We use the following code for the processing. Finaly, the Consolidated dataset has the index as country and date and each of the metric as a column.
All the "Recoveries" related content was removed since the update in the date structure.
Step 3 - Global Data Plots
We plot:
- Confirmed Cases
- Active Cases
- Deaths
- Recoveries
- and the "Death to Case" ratio
All using global data combined.
Step 4 - Top 10 Countries by "Total Confirmed Cases"
From the global data, we sort the 10 worst countries in terms of number of cases.
Step 5 - Comparing Countries
We compare data from 8 countries in terms of Total Confirmed Cases.
Step 6 - All indicators for the US
We revisit our key indicators:
- Confirmed Cases
- Active Cases
- Deaths
- Recoveries
- and the "Death to Case" ratio
but focusing our plots on the US only.
Step 7 - Daily new cases
One metric important to track for the recovery IMO, is the number of new cases per day.
Step 8 - GROWTH
This last chart, displays new confirmed cases of COVID-19 in the past week vs. the total confirmed cases in a log chargt. It was heavily inspired by work done at https://aatishb.com/covidtrends/. When plotted in this way, exponential growth is represented as a straight line that slopes upwards. Notice that almost all countries follow a very similar path of exponential growth.