Jupyter Notebook eror message

Hello community,

I am using a Jupyter Notebook which stopped showing a visualisaiton.
To be more precice the bellow code
df = per_hour_gtp

fig = px.bar(df, x=“hour”, y=“nb_stock_tote”, color=“gtp”, title=“Bacs de stock pickés en GTP”, barmode=“relative”)
fig.update_layout(title=“Bacs de stock pickés en GTP”,
xaxis_title=‘Temps’,
yaxis_title=“Nombre de bacs de stock”)
fig.add_hline(y = 4437, line_dash=“dot”,
annotation_text=“90% flow diagram throughput (= 4437)”,
annotation_position=“top left”)
fig.show()

is throwing the follwoing error:
df = per_hour_gtp

fig = px.bar(df, x=“hour”, y=“nb_stock_tote”, color=“gtp”, title=“Bacs de stock pickés en GTP”, barmode=“relative”) fig.update_layout(title=“Bacs de stock pickés en GTP”, xaxis_title=‘Temps’, yaxis_title=“Nombre de bacs de stock”) fig.add_hline(y = 4437, line_dash=“dot”, annotation_text=“90% flow diagram throughput (= 4437)”, annotation_position=“top left”) fig.show()

Strangelly enough if I am using backup version which is the same as actual it works well giving me the wanting visual.
I am completelly new on Python and jupiter and the dev who created this notebook is no more available.
Your help would be highly apreciated

Sincerely

Paul

You didn’t paste the error. It’s just the same code without line breaks.
Please paste formatted code in blocks flanked by triple ticks so that it retains formatting. See here and here.

This isn’t a minimal reproducible example. For instance, I suspect px.bar comes from Plotly Express? You want to help those that are trying to help you. Not make them guess at what is meant and so provide the import statements, too. Also provide some mock data that gives you the same outcome as you are trying

This is hard to understand. It seems you are saying the same code in a different notebooks works, which seems unlikely then that everything is the same. There has to be something different about the code or where or it is run. One of the notebooks has some code before the part you highlighted so far in your original post?

1 Like