Skip to content

Instantly share code, notes, and snippets.

@anriseth
Last active November 23, 2020 09:51
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 anriseth/e48f0753b19df5b3dacc47f1c1f9d3df to your computer and use it in GitHub Desktop.
Save anriseth/e48f0753b19df5b3dacc47f1c1f9d3df to your computer and use it in GitHub Desktop.
Daily UK covid deaths by region
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