Dear Sir,
I am a newcomer to Streamlit and would like to obtain the selected row from st.data_editor to create a new DataFrame. I have a basic code that I downloaded from the Streamlit sample site, which allows for adding new records, editing cells, and deleting any record with a mouse click. My requirement is to transfer any row selected by the user from st.data_editor to a new DataFrame located below. I would appreciate your guidance and the appropriate code to achieve this, with the initial DataFrame being st.data_editor.
see my code
import streamlit as st
import pandas as pd
df = pd.DataFrame(
[
{“command”: “st.selectbox”, “rating”: 4, “is_widget”: True},
{“command”: “st.balloons”, “rating”: 5, “is_widget”: False},
{“command”: “st.time_input”, “rating”: 3, “is_widget”: True},
]
)
edited_df = st.data_editor(df, num_rows=“dynamic”)