+++ main.py
... | ... | @@ -0,0 +1,12 @@ |
1 | +import pandas as pd | |
2 | +import plotly.express as px | |
3 | + | |
4 | +# Convert hierarchical data into DataFrame | |
5 | +df = pd.read_csv("define_stats.csv") | |
6 | + | |
7 | +df = df[df["category"] == "animal"] | |
8 | + | |
9 | +fig = px.sunburst(df, path=['category', 'value','file_name', ], values='count') | |
10 | +fig.update_layout(margin=dict(t=0, b=0, l=0, r=0), title="물체") | |
11 | +fig.update_traces(textinfo="label+percent parent+value", selector=dict(type='sunburst')) | |
12 | +fig.show()(파일 끝에 줄바꿈 문자 없음) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?