Skip to content

Instantly share code, notes, and snippets.

@mashhadazam
Created March 6, 2020 14:11
Show Gist options
  • Save mashhadazam/1eb9a11ac8be013c2863f054528b419d to your computer and use it in GitHub Desktop.
Save mashhadazam/1eb9a11ac8be013c2863f054528b419d to your computer and use it in GitHub Desktop.
TotalCasesCountry=CountryConsolidated.max(level=0)['Total Confirmed Cases'].reset_index().set_index('Country/Region')
TotalCasesCountry=TotalCasesCountry.sort_values(by='Total Confirmed Cases',ascending=False)
TotalCasesCountryexclChina=TotalCasesCountry[~TotalCasesCountry.index.isin(['Mainland China','Others'])]
Top10countriesbycasesexclChina=TotalCasesCountryexclChina.head(10)
TotalCasesCountrytop10=TotalCasesCountry.head(10)
fig = go.Figure(go.Bar(x=Top10countriesbycasesexclChina.index, y=Top10countriesbycasesexclChina['Total Confirmed Cases'],
text=Top10countriesbycasesexclChina['Total Confirmed Cases'],
textposition='outside'))
fig.update_layout(title_text='Top 10 Countries by Total Confirmed Cases Excluding China')
fig.update_yaxes(showticklabels=False)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment