I need to click twice to update the dataframe and show updated data correctly. The first click is working fine but then i need to always click the second time
def initialize_df():
if 'df' not in st.session_state:
st.session_state.df = pd.DataFrame({'Column 1': [True, True ,True],'Column 2': [4, 5, 6]
})
if 'df' not in st.session_state:
initialize_df()
# Callback function for when the data editor changes
def data_editor_changed():
st.session_state.df.update(st.session_state.df)
st.session_state.df = st.data_editor(st.session_state.df, on_change=data_editor_changed, key='ed')
Please help, I have tried a lot of combinations.
New contributor
Kasper Szczygieł is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.