I am getting the following error when trying to generate a Sunburst plot:
AttributeError: 'DataFrame' object has no attribute 'append'
To check it, I tried to reproduce the example that appears on Plotly documentation:
import plotly.express as px
import numpy as np
df = px.data.gapminder().query("year == 2007")
fig = px.sunburst(df, path=['continent', 'country'], values='pop',
color='lifeExp', hover_data=['iso_alpha'],
color_continuous_scale='RdBu',
color_continuous_midpoint=np.average(df['lifeExp'], weights=df['pop']))
fig.show()
And I am getting the same error.
I believe this issue is related to Pandaβs versions. I upgraded to the latest Pandas/Numpy/Plotly version, but I am still getting the same issue.
My versions are:
pandas 2.2.2
plotly 5.24.0
numpy 2.0.2
Any suggestions?