My P Report
My P Report
PROJECT REPORT:
COVID-19 IMPACTS ANALYSIS
Bsc. (Data Science)
Submitted by submitted to
Mayank Sajwan Dr. Nishant Mathur
22STUCDDD04007
PROJECT REPORT:
DATA SET:
The dataset we are using to analyze the impacts of covid-19 is downloaded from Kaggle. It
contains data about:
data = pd.read_csv("transformed_data.csv")
data2 = pd.read_csv("/raw_data.csv")
print(data)
CODE COUNTRY DATE HDI TC TD ST
I \
0 AFG Afghanistan 2019-12-31 0.498 0.000000 0.000000 0.00000
0
1 AFG Afghanistan 2020-01-01 0.498 0.000000 0.000000 0.00000
0
2 AFG Afghanistan 2020-01-02 0.498 0.000000 0.000000 0.00000
0
3 AFG Afghanistan 2020-01-03 0.498 0.000000 0.000000 0.00000
0
4 AFG Afghanistan 2020-01-04 0.498 0.000000 0.000000 0.00000
0
... ... ... ... ... ... ... ..
.
50413 ZWE Zimbabwe 2020-10-15 0.535 8.994048 5.442418 4.34185
5
50414 ZWE Zimbabwe 2020-10-16 0.535 8.996528 5.442418 4.34185
5
50415 ZWE Zimbabwe 2020-10-17 0.535 8.999496 5.442418 4.34185
5
50416 ZWE Zimbabwe 2020-10-18 0.535 9.000853 5.442418 4.34185
5
50417 ZWE Zimbabwe 2020-10-19 0.535 9.005405 5.442418 4.34185
5
POP GDPCAP
0 17.477233 7.497754
1 17.477233 7.497754
2 17.477233 7.497754
3 17.477233 7.497754
4 17.477233 7.497754
... ... ...
50413 16.514381 7.549491
50414 16.514381 7.549491
50415 16.514381 7.549491
50416 16.514381 7.549491
50417 16.514381 7.549491
DATA PREPARATION:
The dataset that we are using here contains two data files. One file contains raw data, and the
other file contains transformed one. But we have to use both datasets for this task, as both of
them contain equally important information in different columns. So let’s have a look at both the
datasets one by one:
After having initial impressions of both datasets, I found that we have to combine both datasets
by creating a new dataset. But before we create a new dataset, let’s have a look at how many
samples of each country are present in the dataset:
data["COUNTRY"].value_counts()
COUNTRY
Afghanistan 294
Indonesia 294
Macedonia 294
Luxembourg 294
Lithuania 294
...
Tajikistan 172
Comoros 171
Lesotho 158
Hong Kong 51
Solomon Islands 4
Name: count, Length: 210, dtype: int64
So we don’t have an equal number of samples of each country in the dataset. Let’s have a look
at the mode value:
data["COUNTRY"].value_counts().mode()
0 294
Name: count, dtype: int64
So 294 is the mode value. We will need to use it for dividing the sum of all the samples related to
the human development index, GDP per capita, and the population. Now let’s create a new
dataset by combining the necessary columns from both the datasets:
for i in country:
hdi.append((data.loc[data["COUNTRY"] == i, "HDI"]).sum()/294)
tc.append((data2.loc[data2["location"] == i, "total_cases"]).sum())
td.append((data2.loc[data2["location"] == i, "total_deaths"]).sum())
sti.append((data.loc[data["COUNTRY"] == i, "STI"]).sum()/294)
population.append((data2.loc[data2["location"] == i, "population"]).sum()/294)
NEW DATASET(AGGREGATED_DATA) :
Country Code Country HDI Total Cases Total Deaths \
0 AFG Afghanistan 0.498000 5126433.0 165875.0
1 ALB Albania 0.600765 1071951.0 31056.0
2 DZA Algeria 0.754000 4893999.0 206429.0
3 AND Andorra 0.659551 223576.0 9850.0
4 AGO Angola 0.418952 304005.0 11820.0
I have not included the GDP per capita column yet. I didn’t find the correct figures for GDP per
capita in the dataset. So it will be better to manually collect the data about the GDP per capita of
the countries.
As we have so many countries in this data, it will not be easy to manually collect the data about
the GDP per capita of all the countries. So let’s select a subsample from this dataset. To create a
subsample from this dataset, I will be selecting the top 10 countries with the highest number of
covid-19 cases. It will be a perfect sample to study the economic impacts of covid-19. So let’s
sort the data according to the total cases of Covid-19:
Now here’s how we can select the top 10 countries with the highest number of cases:
Now I will add two more columns (GDP per capita before Covid-19, GDP per capita during
Covid-19) to this dataset:
NOTE: THE DATA ABOUT THE GDP PER CAPITA IS COLLECTED MANUALLY.
Analyzing the Spread of Covid-19
Now let’s start by analyzing the spread of covid-19 in all the countries with the highest number of
covid-19 cases. I will first have a look at all the countries with the highest number of covid-19
cases:
Just like the total number of covid-19 cases, the USA is leading in the deaths, with Brazil and
India in the second and third positions. One thing to notice here is that the death rate in India,
Russia, and South Africa is comparatively low according to the total number of cases. Now let’s
compare the total number of cases and total deaths in all these countries:
fig = go.Figure()
fig.add_trace(go.Bar(
x=data["Country"],
y=data["Total Cases"],
name='Total Cases',
marker_color='indianred'
))
fig.add_trace(go.Bar(
x=data["Country"],
y=data["Total Deaths"],
name='Total Deaths',
marker_color='lightsalmon'
))
fig.update_layout(barmode='group', xaxis_tickangle=-45)
fig.show()
Now let’s have a look at the percentage of total deaths and total cases among all the countries
with the highest number of covid-19 cases:
Another important column in this dataset is the stringency index. It is a composite measure of
response indicators, including school closures, workplace closures, and travel bans. It shows
how strictly countries are following these measures to control the spread of covid-19:
Here we can see that India is performing well in the stringency index during the outbreak of
covid-19.
Now let’s compare the GDP per capita before covid-19 and during covid-19 to have a look at the
impact of covid-19 on the GDP per capita:
fig = go.Figure()
fig.add_trace(go.Bar(
x=data["Country"],
y=data["GDP Before Covid"],
name='GDP Per Capita Before Covid-19',
marker_color='indianred'
))
fig.add_trace(go.Bar(
x=data["Country"],
y=data["GDP During Covid"],
name='GDP Per Capita During Covid-19',
marker_color='lightsalmon'
))
fig.update_layout(barmode='group', xaxis_tickangle=-45)
fig.show()
You can see a drop in GDP per capita in all the countries with the highest number of covid-19
cases.
One other important economic factor is Human Development Index. It is a statistic composite
index of life expectancy, education, and per capita indicators. Let’s have a look at how many
countries were spending their budget on the human development:
In [19]:
fig = px.bar(data, x='Country', y='Total Cases',
hover_data=['Population', 'Total Deaths'],
color='HDI', height=400,
title="Human Development Index during Covid-19")
fig.show()
So this is how we can analyze the spread of Covid-19 and its impact on the economy.
CONCLUSION
In this task, we conclude that the spread of covid-19 among the countries and its impact on the
global economy. We saw that the outbreak of covid-19 resulted in the highest number of covid-19
cases and deaths in the united states. One major reason behind this is the stringency index of
the United States. It is comparatively low according to the population. We also analyzed how the
GDP per capita of every country was affected during the outbreak of covid-19.