Adding rows in st.data_editor from loaded dataframe

In case anyone has a similar problem:
a workaround is to reset the index of the dataframe before giving it to data_editor.

st.session_state.df.reset_index(drop=True, inplace=True)

data_editor expects a dataframe with a “RangeIndex”.

2 Likes