I have decorated with st.cache a function which brings data from a dataframe, in order to speed up refreshes etc…
Once this dataframe is exported the following steps are taken.
- this dataframe is displayed in my streamlit app.
- once a button is clicked this dataframe is fed into another decorated function that implements computations on it.
- outputs the computation results in a new dataframe which is the old one with some columns added
Inevitably I have to allow output mutation, but the problem I face is that in step (1) i get as an output the same dataframe as in (3). What can I do in order to always display the initial version of the dataframe?
*although once the values are return from the dataframe I implement df.copy() and I always display the copy in step(1) I get a mutated output. Any ideas?