Data science service: programming, analyses and data visualization
  • Data Science service
  • Projects
  • Blog
  • Subscribe
  • Contact

A Jupyter notebook for visualizing the COVID-19 pandemic

4/2/2020

4 Comments

 
Ruthger Righart
The COVID-19 pandemic has led to a lot of exceptional data visualizations from data scientists around the world. The goal of the current notebook is to provide a simple Python code that allows to make flat visualizations. It displays confirmed cases, recovery and fatality across different countries, corrected for population size and land area. The data are updated on daily basis. An interactive dashboard can be found here.

Package versions 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.
Code Editor

    
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.

    
Picture
An interactive dashboard can be found at this site:
Picture

Any questions or suggestions, feel free to email me at rrighart@googlemail.com .
Take care!

REFERENCES:
  • Time-serie data. https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series
  • Population size and land surface area were taken from Wikipedia and the Worldometers site. A csv can be found at my GitHub repository.

    Want to receive notifications?

Subscribe
4 Comments
Picture
Picture
Picture
Ruthger Righart
Ferney-Voltaire
France

Email: rrighart at googlemail dot com
Tel.: 0033 (0)770071310

Immatriculation au Registre du Commerce et des Sociétés: 833 982 358 R.C.S. Bourg-en-Bresse. Greffe du Tribunal de Commerce, 32 Av Alsace Lorraine, 01011 Bourg-en-Bresse Cedex.
  • Data Science service
  • Projects
  • Blog
  • Subscribe
  • Contact