I have a data - which is very similar to the one here: https://plotly.com/python/sunburst-charts/#rectangular-data-with-missing-values
Trully say I do not see any difference between the example on website, and my data - but with my data i got an error. Can someone help me to see where is the problem?
reason = [None, None, 'Price', 'Changed', 'Price', 'Price', 'Other', 'Price', None, 'Other']
status = ['activated', 'activated', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'activated', 'closed']
region = ['Netherlands', 'Vietnam', 'Egypt', 'Egypt', 'Egypt', 'Hungary', 'Germany', 'Egypt', 'Netherlands', 'Hungary']
value = [10, 20, 10, 15, 20, 14, 15, 16, 18, 20]
df2 = pd.DataFrame(dict(reason=reason, status=status, region=region, value=value))
df2["year"] = "Year 2020"
fig = px.sunburst(df2,path =['year', 'region', 'status', 'reason'],
values = 'value')
gets an error:
ValueError: ('Non-leaves rows are not permitted in the dataframe \n', year Year 2020
region Netherlands
status activated
reason
Name: 8, dtype: object, 'is not a leaf.')