Analytics Vidhya
Published in

Analytics Vidhya

Understanding the impact of Weather conditions on corona virus spread using Data Science

(Image taken from

World Health Organization(WHO) labelled Corona Virus as pandemic. 2,67,013 people from 185 countries tested positive for corona virus.

Data Scientists from all over the world explaining spread of corona virus with various techniques. In this article we will explore the impact of weather conditions on spread of corona virus.

Here are some insights from data of corona virus available in kaggle.

Let’s make some interesting plots from data.

Day wise distribution of cases received is

Day wise distribution of deaths observed is

Country-wise and state-wise lists of confirmed cases are

(very seriously effected counties and states are only plotted)

Weather condition of a city is explained from its temperature, pressure and humidity. In python, weather conditions of any city can be obtained using pyowm package.You just need an api key to avail amazing functions of pyowm. You can read official documentation here.

The code i used to extract weather conditions of city is

I have made a data frame from observations to visualise impact. The correlation of temperature , pressure and humidity with cases is :

Before concluding about correlation, Let’s make some more plots

Since these observations are from different countries , it is too fast to make conclusion. Let’s extend this analysis to observations from single country for better understanding.

India recently crossed starting stage of this pandemic. So let’s take data from India and repeat above analysis.

Data Frame made after pre-processing for analysis is

State-wise chart of active cases is

Data frame made with weather retrieved using pyowm package is

Visualisation of above data frame is

The heat map of correlation matrix is

From heat map, it is clear that temperature , pressure and humidity are not strongly correlated to active cases.

Though temperature is having small role in spread of virus , we can conclude that contact with effected people plays key role in spreading irrespective of weather conditions .

Current situation in INDIA

Future Work

We can make more meaningful observations from day wise collected weather data of particular city. We can make use of this weather data as input to model to predict cases on next day.


We have made exploratory data analysis on these datasets. We have seen the impact of weather conditions on spread of corona virus. Finally I have stated the idea of my next post.The code and data used to make plots and conclusion can be accessed here .

Thanks for reading :))



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store