COVID 19 Analysis with Python

In this article, I will walk you through the task of Global Pandemic COVID 19 Analysis with Python. COVID-19 does not need to be introduced, it is the latest infectious disease to take hold of the whole world. So, have you wondered how the world has changed in recent months? Let’s visualize this change over the months in different countries spread by the COVID 19 pandemic.

In this article, I will use the Choropleth maps, for the task of COVID 19 analysis with Python, as by using Choropleth maps we can analyze the spread across different countries with much less code.

Also, Read – Machine Learning Full Course For free.

What are Choropleth Maps?

The Choropleth maps split the different geographical regions based on statistical data or any other data variable. It is a type of thematic map where different regions are shaded according to the variable considered and the proportion of representation of the variable for a region.

For example, consider the image below which shows the GDP per capita in different countries. The map uses a colour gradation of GDP per capita to denote the different countries on the map below.

Choropleth Maps

COVID 19 Analysis with Python using Folium

Folium is a library in Python that can be used to visualize geospatial data. Leaflet.js is a JavaScript library for creating maps and Folium combines the features of Leaflet with the data management capabilities of python to create beautiful interactive maps.

Folium helps link data to create maps like choropleth and also activates marker functionality with HTML visualizations. Different map projections are also available like orthographic, natural earth, etc. and different map tiles like MapBox, StamenToner, among others.

Now consider the global COVID 19 dataset to create a choropleth map, you can download the dataset that I am using in this task from here.

COVID 19 Analysis with Python

Now let’s start with the task of COVID 19 analysis with Python. First, we need to generate a base map. The following code can be used for this:

Python Folium

Now we need to get the geodata and then generate the choropleth map layer:

We will now add markers with details of the confirmed cases for each country with that code. Markers can be customized, here I am using circular markers:

This is the final result with markers for confirmed and recovered cases. We can hover over the markers to see the number of confirmed and recovered cases by country. In the graphic below, the India marker is highlighted:

COVID 19 Analysis

I hope you liked this article on the pandemic COVID 19 analysis with Python. Feel free to ask your valuable questions in the comments section below.

Follow Us:

Aman Kharwal
Aman Kharwal

I'm a writer and data scientist on a mission to educate others about the incredible power of data📈.

Articles: 1433

6 Comments

  1. Can you share the covid_df used in below code:
    covid_df.apply(plotDot, axis = 1)

    In dataset.csv, latitude and longitude are not avilabale

Leave a Reply