# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # ***Widhya Covid-19 Analysis***

import pandas as pd
import matplotlib.pyplot as plt
# %matplotlib inline
import seaborn as sns

# ### ***Read the csv file***

dataframe=pd.read_csv('https://raw.githubusercontent.com/WidhyaOrg/datasets/master/covid19.csv')
dataframe.head()

# ### ***Dropping the unrelevant feature***

df=df.drop('Sno',axis=1)
df.head()

# ### ***Grouping all the features by date***

df=df.groupby('Date', sort = False).sum()
df.head()

# ### ***Total cases on each day***

df['Total_cases'] = df.sum(axis =1).astype('int')
df

# ### ***Visualization of total number of cases and we can see after 3rd march the cases keep increasing day by day***

plt.figure(figsize=(20,10))
plt.plot(df.Total_cases,color='r')
plt.xticks(rotation = 90, fontsize = 15)
plt.show()

df.tail(20)

# ### ***Rate of increase of each day***

rate=[]
for i in range(0,df.shape[0]-1):
    ratenum=(df['Total_cases'].iloc[i+1]-df['Total_cases'].iloc[i])/df['Total_cases'].iloc[i]
    rate.append(ratenum)

import numpy as np
avg_rate=np.average(rate)
avg_rate

# ### ***Used Exponential Model***

#P_t=P_o*(e^(r*t))
import math 
P_o=31
t=26
P_t=round(P_o*(math.exp(avg_rate*t)))
P_t

# ## ***THANK YOU!!!***

StarcoderdataJupyterScriptsDedupFiltered