Skip to content
Advertisement

Plotly graph is displaying as empty

I have a dataframe with the columns

JavaScript

where data about number of users per certain cars in several weeks is shown.

I made a pivot table

JavaScript

and i’m trying to build a plot with the pivot table in plotly

JavaScript

I get no errors but the graph shows no lines. The x-axis and the line names are correct but the values aren’t displayed in the graph. It’s just empty

Advertisement

Answer

Ìn pivot[pivot.index==name].values, you got a list inside another list.

Just unpack it

Like this:

JavaScript

if want see some clearer, check that colab link https://colab.research.google.com/drive/1vgbfEx4fd2P-2w4bTfjWv1Y76KQxwPow?usp=sharing

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement