Last active
November 23, 2020 09:51
-
-
Save anriseth/e48f0753b19df5b3dacc47f1c1f9d3df to your computer and use it in GitHub Desktop.
Daily UK covid deaths by region
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import matplotlib.pyplot as plt | |
plt.ion() | |
file_url = 'https://data.london.gov.uk/download/coronavirus--covid-19--deaths/516cc869-179d-4cc7-84a4-2cf2fa2d112f/nhse_daily_announced_deaths_by_region.csv' | |
df = pd.read_csv(file_url, index_col=[0, 1], parse_dates=[1]) | |
df_grouped = df.groupby(['nhs_england_region', 'date_of_death']).sum()['new_deaths_total'].unstack(0) | |
df_grouped.ewm(alpha=1/3).mean().plot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment