In [2]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('darkgrid')
import warnings
warnings.filterwarnings("ignore")
In [3]:
data= pd.read_csv("../input/latest-covid19-india-statewise-data/Latest Covid-19 India Status.csv")
In [4]:
data.head()
Out[4]:
In [5]:
data.isnull().sum()
Out[5]:
In [6]:
data.describe()
Out[6]:
In [7]:
plt.figure(figsize=(6,6))
sns.heatmap(data.corr(),annot=True,cmap='summer')
plt.title("Heatmap of the dataset")
Out[7]:
In [8]:
sns.distplot(data.Active,color='Blue')
plt.title("Active cases in India",fontsize=15)
Out[8]:
In [9]:
sns.distplot(data.Deaths,color='Red')
plt.title("Death cases in India",fontsize=15)
Out[9]:
In [10]:
sns.distplot(data['Discharged'],color='Yellow')
plt.title("Discharged cases in India",fontsize=15)
Out[10]:
In [11]:
plt.figure(figsize=(10,10))
sns.barplot(x='State/UTs',y='Total Cases',palette='CMRmap',data=data)
plt.title("The total cases as per State/UTs are",fontsize=15)
plt.xticks(rotation=90)
Out[11]:
In [12]:
plt.figure(figsize=(7,7))
labels = data.index
plt.pie(x='Active',data=data[:5],labels='State/UTs',startangle=90,autopct='%.1f%%')
plt.title("Active Cases in Top 5 states in India", fontsize = 24)
plt.tight_layout()
plt.show()
In [13]:
plt.figure(figsize=(7,7))
labels = data.index
plt.pie(x='Total Cases',data=data[:5],labels='State/UTs',startangle=90,autopct='%.1f%%')
plt.title("Total Cases in Top 5 states in India", fontsize = 24)
plt.tight_layout()
plt.show()
In [14]:
plt.figure(figsize=(7,7))
labels = data.index
plt.pie(x='Discharged',data=data[:5],labels='State/UTs',startangle=90,autopct='%.1f%%')
plt.title("People Discharged in Top 5 states in India", fontsize = 24)
plt.tight_layout()
plt.show()
In [15]:
plt.figure(figsize=(7,7))
labels = data.index
plt.pie(x='Deaths',data=data[:5],labels='State/UTs',startangle=90,autopct='%.1f%%')
plt.title("Deaths in Top 5 states in India", fontsize = 24)
plt.tight_layout()
plt.show()
In [16]:
sns.scatterplot(x='Active Ratio',y='Death Ratio',data=data[:10],palette='Spectral',legend='brief',hue='State/UTs')
plt.title("Top 10 Active Ratio to Deaths Ratio in India",fontsize=15)
Out[16]:
In [17]:
sort_data= data.sort_values(by='Active Ratio',ascending=False)
sns.barplot(x='State/UTs',y='Active Ratio',data=data[:10],palette='copper',hue='Death Ratio')
plt.xticks(rotation=90)
plt.title("Top 10 Active Ratio to Deaths Ratio in India",fontsize=15)
Out[17]:
In [18]:
sns.lineplot(y='Active Ratio',data=data[:10],x='State/UTs')
plt.xticks(rotation=90)
plt.title("Line Plot for Active Ratio",fontsize=15)
Out[18]:
In [19]:
sns.barplot(x='State/UTs',y='Death Ratio',data=data[:10],hue='Death Ratio')
plt.xticks(rotation=90)
plt.title("Top 10 Death Ratio in India",fontsize=15)
Out[19]:
In [20]:
sns.lineplot(y='Death Ratio',data=data[:10],x='State/UTs')
plt.xticks(rotation=90)
plt.title(" Lineplot for Death Ratio",fontsize=15)
Out[20]:
In [21]:
sns.scatterplot(x='Discharge Ratio',y='Active Ratio',data=data[:10],palette='twilight',hue='State/UTs')
plt.title("Discharge Ratio for top 10 states",fontsize=15)
Out[21]:
In [22]:
sns.barplot(x='State/UTs',y='Death Ratio',data=data[:10],hue='Discharge Ratio')
plt.xticks(rotation=90)
plt.title("Top 10 Discharge Ratio in India",fontsize=15)
Out[22]:
In [23]:
sns.lineplot(y='Discharge Ratio',data=data[:10],x='State/UTs')
plt.xticks(rotation=90)
plt.title(" Lineplot for Discharge Ratio",fontsize=15)
Out[23]:
In [24]:
data['Recovered']=data['Total Cases']-(data['Active']+data['Deaths'])
In [25]:
data.head()
Out[25]:
In [26]:
plt.figure(figsize=(10,10))
sns.barplot(x='State/UTs',y='Recovered',palette='CMRmap',data=data)
plt.title("The Recovered cases as per State/UTs are",fontsize=15)
plt.xticks(rotation=90)
Out[26]:
In [27]:
sns.jointplot(x='Recovered',y='State/UTs',data=data)
plt.xticks(rotation=90)
Out[27]:
In [28]:
sns.barplot(x='State/UTs',y='Recovered',data=data[:10])
plt.xticks(rotation=90)
plt.title("Top 10 most affected States",fontsize=15)
Out[28]:
In [29]:
plt.figure(figsize=(10,5))
sns.pointplot(x='State/UTs',y='Recovered',data=data[:10],color='Red')
plt.xticks(rotation=90)
plt.title("recovered in line Plot",fontsize=15)
Out[29]:
In [30]:
plt.figure(figsize=(7,7))
labels = data.index
plt.pie(x='Recovered',data=data[:10],labels='State/UTs',startangle=90,autopct='%.1f%%')
plt.title("Recovery in Top 5 states in India", fontsize = 24)
plt.tight_layout()
plt.show()
In [ ]:
No comments:
Post a Comment