I am trying to create a sunburst chart using a pandas dataframe and plotly express.
Here is dataframe, keep in mind this is only the first 10 rows, once it finishes with the suburbs for 2001, it jumps to the same suburbs for 2006, 2011, 2016
And here is my code
sunburst_chart = px.sunburst(
sunburst_data,
path=["year", "neighbourhood"],
values="average_house_value",
names="neighbourhood",
)
sunburst_chart.show()
The error that is gives me is AttributeError: type object 'object' has no attribute 'dtype'
and is referring to names="neighbourhood"
but if I remove that line the error points to the line above, and repeat.
There are no duplicate rows, no nulls and the dtypes are
year int64
neighbourhood object
average_house_value int64
dtype: object
Any help is much appreciated, thank you