Prevent table reload after editing every entry

I have a Pandas dataframe that I am showing in the form of a st.data_ediitor component.
I am looking for the following functionality

  1. Change some values in the table (which I am able to do so), recalculate other columns based on the changed value and display the updated data in the same view

  2. For evey change that is made in the table, I don’t want all of compoennts to reload.
    I only want my table component to reload after I have made all the changes.

I am struck on this issue from a long time. Please help.

Attaching an example that I came across-

This is the exact functionality I am looking for with the exception that I want some recalculations in other columns based on the edited value and it should be shown in the same view and not as a separate table that is popping up in this app.

Thanks in advance.

1 Like

Hi @ssa_1998

In regards to the first point:

and

You can try to re-assign new set of values to the existing column (that is you are assigning the new values to an existing column) via something like:

df["column_name"] = [1,2,3,4,5]  # Updated list of values

In regards to the second point:

As the app logic of Streamlit is to rerun the app from top to bottom with every widget interaction, what you can do to circumvent this is to apply caching so that calculations, plots, or data would not have to be loaded/created from scratch and rather can be pulled from the cache in subsequent app refreshes.

Widget values can be assigned to session state variables so that when the app refreshes, it will be able to retrieve the widget values from session state variables so that it would appear to instantly load upon app refreshes.

Hope this helps!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.