Created
November 28, 2021 09:56
-
-
Save Dapid/3098b23f04321ce03d064b3606298942 to your computer and use it in GitHub Desktop.
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 pylab as plt | |
df_allcauses = pd.read_excel('datasetfinalcorrected3.xlsx', sheet_name='Table 2', header=4, nrows=38) | |
df_covid = pd.read_excel('datasetfinalcorrected3.xlsx', sheet_name='Table 1', header=4, nrows=38) | |
for k in df_covid.keys(): | |
if k.startswith('Age-st'): | |
df_covid[k] = pd.to_numeric(df_covid[k], errors='coerce').fillna(0) | |
df_allcauses[k] =pd.to_numeric( df_allcauses[k], errors='coerce').fillna(0) | |
assert (df_covid['Week number'] == df_allcauses['Week number']).all() | |
plt.plot(df_allcauses['Week number'], df_allcauses['Age-standardised mortality rate per 100,000'], label='Unvaccinated') | |
plt.plot(df_allcauses['Week number'], df_allcauses['Age-standardised mortality rate per 100,000.3'], label='Fully vaccinated') | |
plt.legend() | |
plt.xlabel('Week number') | |
plt.title('Age-standardised mortality rate per 100,000 in England, 2021') | |
plt.figure() | |
plt.plot(df_covid['Week number'], df_allcauses['Age-standardised mortality rate per 100,000'] - df_covid['Age-standardised mortality rate per 100,000'], label='Unvaccinated') | |
plt.plot(df_covid['Week number'], df_allcauses['Age-standardised mortality rate per 100,000.3'] - df_covid['Age-standardised mortality rate per 100,000.3'], label='Fully vaccinated') | |
plt.legend() | |
plt.xlabel('Week number') | |
plt.title('COVID-excluded Age-standardised mortality rate per 100,000 in England, 2021') | |
plt.figure() | |
plt.plot(df_covid['Week number'], df_covid['Age-standardised mortality rate per 100,000'], label='Unvaccinated') | |
plt.plot(df_covid['Week number'], df_covid['Age-standardised mortality rate per 100,000.3'], label='Fully vaccinated') | |
plt.legend() | |
plt.xlabel('Week number') | |
plt.title('COVID age-standardised mortality rate per 100,000 in England, 2021') | |
plt.show() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment