Skip to content

Instantly share code, notes, and snippets.

@ghtmtt
Last active Apr 15, 2020
Embed
What would you like to do?
import pandas as pd
import plotly.express as px
df = pd.read_csv("https://gist.github.com/ghtmtt/66164cc25a7b160cef99fa61b2feca59/raw/3034facfdecf7358934d9f0a78341c4d13f2af47/covid-pandas.csv")
col = [col for col in df.columns if '20' in col]
dfm = pd.melt(
df,
id_vars=["Province/State", "Country/Region", "continent", "Lat", "Long"],
value_vars=col,
var_name="Date",
value_name="Cases"
)
fig = px.bar(
dfm,
x="Country/Region",
y="Cases",
facet_col="continent"
)
fig.update_xaxes(matches=None)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment