✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Some Error when creating treemap

Hi I am trying to create a treemap, the cell in jupyter notebook is executed without any errors but I couldn’t able to see the figure.

Sample dataframe -


id views comments category
0 5019 148896 28 Artistic Visualization
1 1416 81374 26 Visualization
2 1416 81374 26 Featured
3 3485 80819 37 Featured
4 3485 80819 37 Mapping

Treemap code used -

import plotly.express as px
fig = px.treemap(data_frame=posts,names =‘category’,values =‘views’,color =‘comments’)

I read the document of the plotly express treemap and it looks like all the arguments are rights to plot the graph but don’t know why is it not showing, I am just getting a blank space.

Can anyone help me with this.

1 Like