Page refreshes after file upload

Hi @Manu.This is a problem which doesn’t have a oficial solution, called SessionState. There are some workarounds the community created, you can check this out here:

While i was develop my streamlit app, i had a similar problem as you, but was with st.number_input. Recently streamlit launch a new feature called st.forms which the aim is prevent the input that are located inside this form do not refresh, you can check following the link below:

Here there is a snippet of my code which include maybe the problem you facing:

p_toleranciamento = st.number_input("Percentage of Tolerance (P or K): ")

        t_tolerancia = st.number_input("Tolerance (T): ")

        n_desvios_padroes = st.number_input("Number of Standard Deviation (w): ")

        #qtd_pontos = st.number_input("Digite a Quantidade de Amostras (n): ")

        # Botão para calcular o índice Cg

        submit_button_1 = st.form_submit_button(label="Submit Values")

        # Calculo do indice de capabilidade Cg:

        if submit_button_1:

            col1, mid, col2 = st.beta_columns([10,5,20])

            with col1:

                df2 = df.rename(columns={'AMOSTRA':'Samples'}, inplace=True)