Last active
February 7, 2022 19:42
-
-
Save jonodrew/a28a11f1b2da1a8f3d0d03954bcd3a01 to your computer and use it in GitHub Desktop.
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
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