i want a data_editor widget with a multiselect option in a column
To upload files, please first save the app
import streamlit as st
import pandas as pd
# Create sample data
data = {
"name": ["John", "Alice", "Bob", "Carol"],
"interests": [
["Python", "Data Science"],
["Machine Learning", "AI"],
["Web Development", "Python"],
["AI", "Data Science"]
]
}
df = pd.DataFrame(data)
# Create data editor with multiselect column
edited_df = st.data_editor(
df,
column_config={
"interests": st.column_config.SelectboxColumn(
"Interests",
help="Select multiple interests",
width="medium",
options=[
"Python",
"Data Science",
"Machine Learning",
"AI",
"Web Development"
],
)
},
hide_index=True,
num_rows="dynamic"
)
# Display the edited data
st.write("Edited data:")
st.write(edited_df)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?