Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created November 29, 2020 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/3da5aa7233c118ad317c2b3cddbffec3 to your computer and use it in GitHub Desktop.
Save amankharwal/3da5aa7233c118ad317c2b3cddbffec3 to your computer and use it in GitHub Desktop.
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