data_editor

This commit is contained in:
leo
2024-03-06 20:56:52 +08:00
parent 8d4eb36893
commit b292819107

View File

@@ -9,5 +9,8 @@ df = pd.DataFrame(
data=(BatchDataRead.from_orm(db_obj).dict()
for db_obj in session.query(BatchData).all())
)
#
st.dataframe(df, use_container_width=True)
edited_df = st.data_editor(df) # 👈 An editable dataframe
favorite_command = edited_df.loc[edited_df["id"].idxmax()]
st.markdown(f"Your favorite command is **{favorite_command}** 🎈")