Skip to content

Commit ebc1b76

Browse files
committed
fixed an issue with daily changes tables
1 parent 50031e6 commit ebc1b76

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

COVanal.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
top10DD = tDD.nlargest(10, 'Total Deaths')
3333
top10CD['24 hour change'] = top10CD[yesterday.strftime('%#m/%#d/%y')] - top10CD[otherday.strftime('%#m/%#d/%y')]
3434
top10DD['24 hour change'] = top10DD[yesterday.strftime('%#m/%#d/%y')] - top10DD[otherday.strftime('%#m/%#d/%y')]
35-
newtop10CD = top10CD[['Country/Region', 'Total Confirmed Cases', '24 hour change']]
36-
newtop10DD = top10DD[['Country/Region', 'Total Deaths', '24 hour change']]
35+
newtop10CD = top10CD[['Country/Region', '24 hour change', 'Total Confirmed Cases']]
36+
newtop10DD = top10DD[['Country/Region', '24 hour change', 'Total Deaths']]
3737

3838
#Creates the data used for tables containing top 10 changes in countries deaths and cases
3939
top10changeCD = tCD.nlargest(10, '24 hour change')
@@ -78,12 +78,12 @@ def create_daily_top_10_changes_tables():
7878
axs[0].set_title('Countries With Largest Change in Confirmed COVID Cases (24 hours)', pad=10)
7979
axs[0].axis('off')
8080
axs[0].axis('tight')
81-
axs[0].table(cellText=newtop10CD.values, colLabels=newtop10changeCD.columns, loc='center')
81+
axs[0].table(cellText=newtop10changeCD.values, colLabels=newtop10changeCD.columns, loc='center')
8282

8383
axs[1].set_title('Countries With Most COVID Deaths (24 hours)', pad=10)
8484
axs[1].axis('off')
8585
axs[1].axis('tight')
86-
axs[1].table(cellText=newtop10DD.values, colLabels=newtop10changeDD.columns, loc='center')
86+
axs[1].table(cellText=newtop10changeDD.values, colLabels=newtop10changeDD.columns, loc='center')
8787
fig.tight_layout(pad=2)
8888
plt.savefig(dt.date.today().strftime('%m%d%y') + 'daily.png')
8989

0 commit comments

Comments
 (0)