Skip to content

Instantly share code, notes, and snippets.

@jonodrew
Last active February 7, 2022 19:42
Show Gist options
  • Save jonodrew/a28a11f1b2da1a8f3d0d03954bcd3a01 to your computer and use it in GitHub Desktop.
Save jonodrew/a28a11f1b2da1a8f3d0d03954bcd3a01 to your computer and use it in GitHub Desktop.
import plotly.express as px
import pandas as pd
def generate_df():
data = {
"names": ["alice", "bob", "chuck", "david", "ella", "fred"],
"parents": ["", "alice", "bob", "chuck", "david", "david"],
}
return pd.DataFrame(data)
def plot():
px.sunburst(
generate_df(),
names=["alice", "bob", "chuck", "david", "ella", "fred"],
parents=["", "alice", "bob", "chuck", "david", "david"],
values=[0, 0, 1, 0, 1, 1]
).show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment