Page Reset On Slider Change

Hello Streamlit friends!

First of all, huge thank you for the incredible work here.

I have a problem I’m sure you can help:

  • Using a json from an API call file loaded in pandas to create a DataFrame.
  • All work fine, data is loaded, sliders and textbox created, DataFrame displayed, calculations and graphs.

But, when the user makes a change in any of the sliders, the page resets to the initial state, only user textboxes, labels, markdown, and buttons are displayed and all data loaded is lost.

Could you please be kind and help me?

Pandas v1.2.1
Streamlit v0.79.0
Python v3.9.2

Without seeing code, unfortunately, you can only guess… :neutral_face:
I would possibly use the @streamlit.cache decorator for your api load function, as long as the data from the api only needs to be loaded once when your streamlit app is called.

Thanks @Franky1, I asked a Sr. Developer and did not authorized the code share.

But looks like this:

def main()calls

def intro() [banner, headers, text_inputs, button to call next function] → calls

def datacollection() [this is the json file pulling, json_normalize, DataFrame creation, calculations {finding maxs, avgs, %, etc}, sliders] → calls

results() [displays the DataFrame, and values of the calculated columns]

Does it makes sense?