• Home
  • Skills
  • Work
  • Blog
  • About
  • Contact

Covid Cases Visual

Python

Requirements

Construct an interactive COVID-19 comparison program which will compare the virus data between two countries. The data should be up-to-date and give options for the user to choose the two countries. The graphs should be line charts and include total cases and mortalities. The generated graph should also be interactive and allow the user to click on the graph to display additional information.

Description

Built a program using the Python matplotlib and requests library. The program utilizes the World Health Organization CSV database for update information on the COVID-19 pandemic. The requests module reads the data in CSV format and retrieves the relevant information back to the user. The data is then aggregated, cleaned, and positioned to be used in a linear chart format using the matplotlib library. The program meets the interactive component of the requirements by allowing the user the to click within the grid lines for exact values at the selected position; as the COVID data is large and is usually portrayed in millions and hundreds of thousands this is helpful to get information to the dot.

Challenges

  1. Creating separate plots for two different comparisons of the data
    1. SOLUTION: The matploblib library conveniently provides a method called subplots which allows to create several graphs within a single window.
  2. Adding the clickability component to the graph.
    1. SOLUTION: Using the annotate method of the matploblib library you can add annotations to the plot on click. The cursor tracking is maintained via the onclick method in the program.


View on GitHub | ↩ Back to Projects

Site by Maxim Shelepov. Icons by Icons8.