Prepared by Mahsa Sadi on 2020 - 06 - 25
In this notebook, we visualize CoVID 19 outbreak in different countries.
Note: The analyzed data sets are downloaded from Kaggle and they do not reflect the real situation.
import pandas
import matplotlib
import seaborn
%matplotlib inline
from matplotlib import pyplot
data_set = pandas.read_csv ('covid_19_india.csv')
data_set_italy = pandas.read_csv ('covid_19_italy.csv')
data_set.shape
data_set.info ()
data_set.describe ()
data_set.tail (5)
data_set ['Deaths'].sum ()
data_set ['Cured'].sum ()
fig_dims = (100, 20)
fig, ax = pyplot.subplots(figsize=fig_dims)
plot = seaborn.barplot ( x = 'State/UnionTerritory', y = 'Deaths', ax = ax, data = data_set)
plot.axes.set_title("Deaths in States",fontsize=50)
plot.set_xlabel("Covid 19 - Deaths - India - States",fontsize=100)
plot.set_ylabel("Count",fontsize=50)
plot.tick_params(labelsize= 50)
ax.tick_params (axis = 'x', labelrotation = 90)
fig_dims = (100, 20)
fig, ax = pyplot.subplots(figsize=fig_dims)
plot = seaborn.barplot ( x = 'State/UnionTerritory', y = 'Cured', ax = ax, data = data_set)
plot.axes.set_title("Recoverd in States in States",fontsize=50)
plot.set_xlabel("Covid 19 - Recovered - India - States",fontsize=100)
plot.set_ylabel("Count",fontsize=50)
plot.tick_params(labelsize= 50)
ax.tick_params (axis = 'x', labelrotation = 90)
months = []
for i in range (0, len (data_set ['Date'])):
temp = data_set ['Date'][i]
st = temp.split ('/')
months.append (st [1][1])
df = pandas.DataFrame(data = months, columns = ['Month'])
augmented_data_set = pandas.concat ( [data_set, df], axis = 1)
augmented_data_set.head (5)
augmented_data_set.describe ()
fig_dims = (10, 5)
fig, ax = pyplot.subplots(figsize=fig_dims)
plot = seaborn.barplot ( x = 'Month', y = 'Confirmed', data = augmented_data_set)
plot.axes.set_title("Confirmed Cases per Month in India",fontsize=20)
fig_dims = (10, 5)
fig, ax = pyplot.subplots(figsize=fig_dims)
plot = seaborn.barplot ( x = 'Month', y = 'Deaths', data = augmented_data_set)
plot.axes.set_title("Deaths per Month in India",fontsize=20)
fig_dims = (10, 5)
fig, ax = pyplot.subplots(figsize=fig_dims)
plot = seaborn.barplot ( x = 'Month', y = 'Cured', data = augmented_data_set)
plot.axes.set_title("Recovered Cases per Month in India",fontsize=20)
data_set_italy.head (5)
data_set_italy.shape
fig_dims = (100, 20)
fig, ax = pyplot.subplots(figsize=fig_dims)
plot = seaborn.barplot ( x = 'RegionName', y = 'Deaths', ax = ax, data = data_set_italy)
plot.set_xlabel("Covid 19 - Deaths - Italy - Regions",fontsize=100)
plot.set_ylabel("Count",fontsize=50)
plot.tick_params(labelsize= 50)
ax.tick_params (axis = 'x', labelrotation = 90)
fig_dims = (100, 20)
fig, ax = pyplot.subplots(figsize=fig_dims)
plot = seaborn.barplot ( x = 'RegionName', y = 'Recovered', ax = ax, data = data_set_italy)
plot.axes.set_title("Recovered in Regions",fontsize=50)
plot.set_xlabel("Covid 19 - Recovered - Italy - Regions",fontsize=100)
plot.set_ylabel("Count",fontsize=50)
plot.tick_params(labelsize= 50)
ax.tick_params (axis = 'x', labelrotation = 90)
months = []
for i in range (0, len (data_set_italy ['Date'])):
temp = data_set_italy ['Date'][i]
months.append (temp.split ('-')[1][1])
df = pandas.DataFrame(data = months, columns = ['Month'])
augmented_data_set_italy = pandas.concat ( [data_set_italy, df], axis = 1)
augmented_data_set_italy.head (5)
fig_dims = (10, 5)
fig, ax = pyplot.subplots(figsize=fig_dims)
plot = seaborn.barplot ( x = 'Month', y = 'TotalPositiveCases', data = augmented_data_set_italy)
plot.axes.set_title("Total Positive Cases per Month in Italy",fontsize=20)
fig_dims = (10, 5)
fig, ax = pyplot.subplots(figsize=fig_dims)
plot = seaborn.barplot ( x = 'Month', y = 'Deaths', data = augmented_data_set_italy)
plot.axes.set_title("Deaths per Month in Italy",fontsize = 20)
fig_dims = (10, 5)
fig, ax = pyplot.subplots(figsize=fig_dims)
plot = seaborn.barplot ( x = 'Month', y = 'Recovered', data = augmented_data_set_italy)
plot.axes.set_title("Recovered Cases per Month in Italy",fontsize = 20)