A simple visualization of the COVID-19 pandemic

The COVID-19 pandemic resulted in extensive data visualizations around the world. The goal of this blog is to provide a simple flat visualization (including Python code) as well as an interactive dashboard. It displays confirmed and recovered cases, and fatality rates across different countries, with the option to correct for example for population size (per 1 million inhabitants). The data are updated on daily basis. An interactive dashboard can be consulted here.

Package versions used:
The following packages were used: numpy==1.18.1, pandas==1.0.1, matplotlib==3.1.3, and seaborn==0.10.0. A Docker container to run the code was created at GitHub. The original notebook file can be found here. The same code is displayed here:

The following function allows to load, process, and visualize the COVID-19 data. The data are loaded from 2 GitHub repositories. The function has the following parameters:

  • filename: ‘Confirmed’, ‘Fatality’, ‘Recovered’.
  • countries: list of countries to be displayed. A separate file countries.csv was created with population size and land area,
  • pop: ‘absolute’ to display frequencies, ‘inhabitant’ to display per capita, and ‘area’ to correct for land surface area,
  • number: give the number used for correction, for ex. 1000000 inhabitants or 10000 km2 area,
  • date1: is the start date for data to be displayed, for ex. ‘2020–02–29’
  • date2: is the end date for data to be displayed, for ex. ‘2020–04–02’

A country_list will be used to select the countries to be displayed. The function data_visualization allows to display the data, and easily check visualizations under different conditions.

An interactive dashboard can be found at this site . The animation below displays some of the options:

Does any of the countries show signs of improvement?

Any questions or suggestions, please feel free to contact me.

Ruthger Righart

Email: rrighart@googlemail.com

Web: https://www.rrighart.com

LinkedIn: https://fr.linkedin.com/in/ruthger-righart

References:

Part of this content was published elsewhere

--

--

Ruthger Righart
A simple visualization of the COVID-19 pandemic

I am passionate about data science and particularly topics about machine learning and computer vision applications.