You can assign the st.data_editor to a variable, and then access the column “favorite” from it (the column that you have set the st.column_config.CheckboxColumn). The code below produces the following result:
import pandas as pd
import streamlit as st
data_df = pd.DataFrame(
{
"widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],
"favorite": [True, False, False, True],
}
)
test = st.data_editor(
data_df,
column_config={
"favorite": st.column_config.CheckboxColumn(
"Your favorite?",
help="Select your **favorite** widgets",
default=False,
)
},
disabled=["widgets"],
hide_index=True,
)
st.text(test)
st.text(test['favorite'])