From b2928191076ea4e148694e1a692b04970984f313 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 6 Mar 2024 20:56:52 +0800 Subject: [PATCH] data_editor --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index bb9b0f3..a8273a6 100644 --- a/main.py +++ b/main.py @@ -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}** 🎈")