Get help from the marimo community

Updated 4 weeks ago

difference in execution between publicly shared project link and editor

I am editing a dataframe to replace null values with "unknown" prior to rendering it in a chart with Plotly. When the notebook runs in the online editor, it works as expected. However, if I share the link to the notebook with the project publish button, it seems that the cell rendering the chart somehow runs before the cell that replaces the values.
M
A
M
4 comments
Could you link your notebook? Or is the code private?
It sounds like the cells that are running out-of-order may not actually be ordered.

marimo can't track mutations, so if you are editing a dataframe, you need to either edit it in the same cell in which it's defined, or reassign the dataframe to a new variable in each cell that it is edited.

If this is actually the problem, there is an explanation here: https://docs.marimo.io/guides/reactivity.html#avoid-mutating-variables
Attachment
image.png
I believe you're right, I moved some code around and now it seems to be working. Thanks for the reminder about this!
Add a reply
Sign up and join the conversation on Discord