Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Nov 29, 2020
Embed
What would you like to do?
count = []
for i in range(1,len(df0)):
count.append(sum(pd.to_numeric(df0.iloc[i,1:].values)))
df = pd.DataFrame()
df["Date"] = df0["Country/Region"][1:]
df["Cases"] = count
df=df.set_index("Date")
count = []
for i in range(1,len(df1)):
count.append(sum(pd.to_numeric(df1.iloc[i,1:].values)))
df["Deaths"] = count
df.Cases.plot(title="Daily Covid19 Cases in World",marker=".",figsize=(10,5),label="daily cases")
df.Cases.rolling(window=5).mean().plot(figsize=(10,5),label="MA5")
plt.ylabel("Cases")
plt.legend()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment