Created
February 22, 2021 11:10
-
-
Save mjam03/71dd38c44deecabf930d56ba2b5ad867 to your computer and use it in GitHub Desktop.
test_7
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
fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(24,7)) | |
df_ew_ed[['week_end', 'Deaths', 'RespiratoryDeaths']].set_index('week_end').plot(ax=ax[0]); | |
ax[0].set_title('Weekly Respiratory and Total Death Count in England & Wales', fontdict={'fontsize': 14}) | |
ax[0].set_xlabel('Time'); | |
ax[0].set_ylabel('Death Count'); | |
ax[0].set_yticklabels(['{:,}'.format(int(x)) for x in ax[0].get_yticks().tolist()]); | |
pd.DataFrame({'Respiratory Deaths as % of Total Deaths': df_ew_ed['RespiratoryDeaths'].divide(df_ew_ed['Deaths'])}).set_index(df_ew_ed['week_end']).plot(ax=ax[1]); | |
ax[1].set_title('Respiratory Deaths as % of Total Deaths', fontdict={'fontsize': 14}) | |
ax[1].set_xlabel('Time'); | |
ax[1].set_ylabel('% Deaths'); | |
ax[1].set_yticklabels(['{:,}'.format(int(x*100))+'%' for x in ax[1].get_yticks().tolist()]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment