COVID-19 in India: Visualising the data

Rahul Kumar Singh
4 min readJul 5, 2020

--

In my first blog post, I plan to use the data visualization techniques that I have learned over this lockdown period, to analyze the COVID-19 statistics in India.

The python packages that I would be using for data visualization are Matplotlib, Geopandas, and Beautiful Soup for Web Scraping.

To start, I have created an animation to understand how COVID-19 spread to the world.

The python library ‘Cartopy’ ( which is built on top Matplotlib), was used to create the above animation.
Cartopy (a library built on top of Matplotlib) was used to create the above animation.

A brief history:

The first case of COVID-19 in India was reported on 3rd January 2020. As of 4th July, India has a confirmed total of 648,315 cases, 394,226 recoveries, and 18,655 deaths in the country. Prime Minister Narendra Modi had declared a nation-wide lockdown on 24th March, which continued till 1st June, after which the state started unlocking in phases. India currently has the largest number of confirmed cases in Asia, and the fourth-highest number of confirmed cases in the world.

Visualizing the data:

India as a whole:

Data as of 3rd July

This graph shows the number of confirmed COVID-19 cases on a particular day. It is used to visualize the growth of reported instances daily.

Data as of 3rd July (Cumulative)

The graphs above show the total confirmed cases, in a linear as well as a logarithmic scale. Statisticians often prefer to plot data like these on a logarithmic scale, because it helps in understanding the bigger picture. Since infectious diseases do not spread in an even, linear way, plotting the data on a linear scale, just leads to a graph in which the rate of growth keeps fluctuating, thus making it difficult to draw inferences from the chart. Therefore, the logarithmic scale is ideal to understand rates of change, rate of growth, specifically in our case.

Data as of 3rd July (Cumulative)
Data as of 3rd July

As we can see above, the number of deaths daily is gradually increasing, with a sudden spike on 17th June. The number of fatalities on that day increase from 308 to 2003. This anomaly in the number of deaths was because Maharashtra and Delhi added earlier deaths that were not attributed to the disease.

State-Wise Data:

Data as of 4th July

The above animation shows the state-wise distribution of the total number of cases, the number of cured patients, and the number of deaths. As seen above, Maharashtra has the highest number of total cases, followed by Tamil Nadu. Maharashtra also has the highest number of cured patients, as well as deaths followed by Delhi and Tamil Nadu.

Data as of 4th July

The above animation shows the choropleth maps of the state-wise, total cases, recoveries, and deaths.

Choropleth maps are a better alternative to the horizontal bar graphs when it comes to plotting the state-wise data, as it allows better perception of the data. It is especially good for understanding the spatial distribution of data.

The Way Forward:

  1. We all should act as responsible citizens, by adhering to the guidelines laid down by the government.
  2. People should maintain personal hygiene and should wear protective masks to protect themselves as well as others from the virus.
  3. People who have been infected should follow the correct quarantine protocols to prevent the spread of the disease.
  4. Social distancing is going to be a norm soon until a vaccine is invented. We as citizens need to do all that we can to help fight the virus, as we all have a role in limiting the spread of the virus.

Data Sources:

  1. WHO has provided data regarding the number of cases and deaths of every country.
  2. The state-wise data can be found on the Ministry of Health and Family Welfare’s official website, which was web-scraped by using Beautiful Soup.
  3. The data for the animation was taken from this website.

Code:

The data and the code for all the above charts and animations have been uploaded on the following Github repository.

Thank You, if you made it this far. Please post any kind of suggestions in the response section below, so that I can improve the content.

--

--