Covid-19 Data Visualization
The skills I demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.
Data Science Introduction
Data has told us that the world has changed in Covid-19 Pandemic. In past over two years, many scientists, biologists, and many others have been trying to stop or reduce the speed of covid virus spreading. It is an analysis opportunity to know the reason of spreading of virus. This project will tell, how to preprocess and merge datasets to calculate needed measures and prepare them for an Analysis of spreading of covid. It feels surreal to imagine how the virus began to spread from one person that is patient zero to four million today.
Dataset
The dataset is of Covid 19 cases report is showing as following: Daily Confirmed, Total Confirmed, Daily Recovered, Total Recovered, Daily Deceased, Total Deceased.
Analysis Process
Loading the Data sets
- Importing Libraries - libraries like pandas, numpy, matplotlib
- Loading and show the dataset - loading covid-19 data set file
Exploring the Train Data sets
- Check the dataset by rows and columns - know the structure of data set
- See the features in the Dataset - find the data type and number of observations in each column
Variables in Data set are stored to plot the graphs.
- ‘Daily Confirmed’ corona virus cases stored in a variable
- ‘Daily Recovered’ corona virus cases stored in a variable
- ‘Daily Deceased’ corona virus cases stored in a variable
- ‘Date’ column stored in a variable
Y = datadf.iloc[61:,1].values # Confirmed
R = datadf.iloc[61:,3].values # Recovered
D = datadf.iloc[61:,5].values # Deceased
X = datadf.iloc[61:,0] # Stores
plt.plot(X,Y)
Data Plotting
The plot function takes two arguments that are X-axis values and Y-axis values plot. X-axis will pass the ‘Dates’ and Y-axis has ‘Number of Confirmed Cases’ to plot. Number of cases by dates are showing in this graph.
Fig: Number of cases by dates
Aesthetics Presentation
The aesthetics presentation of the graph such as labels, titles, color and size to make a clear vision.
plt.figure(figsize=(25,8))
ax = plt.axes()
ax.grid(linewidth=0.4, color='#8f8f8f')
ax.set_facecolor("black")
ax.set_xlabel('\nDate',size=20,color='#4bb4f2')
ax.set_ylabel('Number of Confirmed Cases\n', size=20,color='#4bb4f2')
plt.title("COVID-19 IN : Daily Confirmed\n", size=30,color='#28a9ff')
ax.plot(X,Y, color='#1F77B4', marker='o', linewidth=4, markersize=15, markeredgecolor='#035E9B')
Fig: Number cases by dates in an aesthetics presentation
Pie Chart
This Pie Chart is use to understand the how the virus is spreading based on Travel, Place Visit and Unknown reason the Pie Chart is required.
slices = [62, 142, 195]
activities = ['Travel', 'Place Visit', 'Unknown']
cols=['#4C8BE2','#00e061','#fe073a']
exp = [0.2,0.02,0.02]
plt.pie(slices,labels=activities, textprops=dict(size=15,color='black'), radius=1, colors=cols, autopct='%2.2f%%', explode=exp, shadow=True, startangle=90)
plt.title('Transmission\n',color='#4fb4f2',size=20)
Main reason is shown by pie chart is unknown with 48.87% and place visit is next following by travel. People mobility is biggest reason of increasing of covid cases.
Data Science Conclusion
Covid-19 Cases have been dramatically affected by the many reasons. There are variations mobility of people is creating the prominent issues in each of the counties. The visualizations of the spreading variations that can be helpful to understand how the pandemic affected rapidly in each country.
- Cases are increasing by the time
- Chart is showing daily confirm cases are rapidly increasing by place visiting (35.59%) and traveling (15.54%)
- It is also clearly visible that unknown reason of cases (48.87%) is dangerous