By Niharika P, Fri 08 May 2020, in category Corona virus
Coronavirus disease (COVID-19) is an infectious disease caused by a newly discovered coronavirus.
Most people infected with the COVID-19 virus will experience mild to moderate respiratory illness and recover without requiring special treatment. Older people, and those with underlying medical problems like cardiovascular disease, diabetes, chronic respiratory disease, and cancer are more likely to develop serious illness.
The best way to prevent and slow down transmission is be well informed about the COVID-19 virus, the disease it causes and how it spreads. Protect yourself and others from infection by washing your hands or using an alcohol based rub frequently and not touching your face.
This notebook analyzes the spread of corona virus in India.
import plotly.graph_objects as go
import plotly.offline as py
autosize =False
# Use `hole` to create a donut-like pie chart
values=[4100000, 1400000, 282000]
labels=['Confirmed',"Recovered","Deaths"]
fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=.3)])
fig.update_traces(hoverinfo='label+percent', textinfo='value',textfont_size=15,
marker=dict(colors=['#00008b','#fffdd0'], line=dict(color='#FFFFFF', width=2.5)))
fig.update_layout(
title='COVID-19 ACTIVE CASES VS CURED WORLDWIDE')
py.iplot(fig)
# Use `hole` to create a donut-like pie chart
values=[67152, 20917, 2206]
labels=['Confirmed',"Recovered","Deaths"]
fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=.3)])
fig.update_traces(hoverinfo='label+percent', textinfo='value',textfont_size=15,
marker=dict(colors=['#DAA520','#800000'], line=dict(color='#FFFFFF', width=2.5)))
fig.update_layout(
title='COVID-19 ACTIVE CASES VS CURED INDIA')
austosize=False
py.iplot(fig)
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the "../input/" directory.
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname, _, filenames in os.walk('/kaggle/input'):
for filename in filenames:
print(os.path.join(dirname, filename))
# Any results you write to the current directory are saved as output.
import pandas as pd
pd.plotting.register_matplotlib_converters()
import matplotlib.pyplot as plt
%matplotlib inline
import geopandas
import seaborn as sns
data=pd.read_csv("../input/covid19-corona-virus-india-dataset/complete.csv")
data.tail()
import json
import folium
statecases=data.groupby('Name of State / UT')['Total Confirmed cases','Death','Cured/Discharged/Migrated'].max().reset_index()
with open('/kaggle/input/indian-state-geojson-data/india_state_geo.json') as file:
geojsonData = json.load(file)
for i in geojsonData['features']:
if(i['properties']['NAME_1']=='Orissa'):
i['properties']['NAME_1']='Odisha'
elif(i['properties']['NAME_1']=='Uttaranchal'):
i['properties']['NAME_1']='Uttarakhand'
for i in geojsonData['features']:
i['id'] = i['properties']['NAME_1']
map_choropleth = folium.Map(location = [20.5937,78.9629], zoom_start = 4)
folium.Choropleth(geo_data=geojsonData,
data=statecases,
name='CHOROPLETH',
key_on='feature.id',
columns = ['Name of State / UT','Total Confirmed cases'],
fill_color='YlOrRd',
fill_opacity=0.7,
line_opacity=0.8,
legend_name='Confirmed Cases',
highlight=True).add_to(map_choropleth)
folium.LayerControl().add_to(map_choropleth)
display(map_choropleth)