I have a data frame and I need to select data from one column using selectbox() and then multi-select data from the dropdown list by using multiselect(), anybody knows how to set default value since multiselect() needs to set a default value.
First selectbox(columnB), then multiselect(columnC)
First welcome back* to the Streamlit community!
When creating a question we recommend you follow these guidelines to help you create a question that is more likely to get an answer:
Welcome to the Questions
category, the place to be if you’re having issues with your code, want to chat on Streamlit best practices or share some exotic code snippets with other users
Don’t hesitate to post any problem you’re having with Streamlit there, so other people can discuss it with you ! If you have trouble writing about your issue, from our experience the following details help a lot :
A quick description of what you are trying to achieve and the roadb…
st.multiselect does not need to have a default value, but
st.selectbox does. Check out our docs on each of these to know how to pass all of the possible parameters to the widgets:
Here is a code example:
import streamlit as st
select = st.selectbox("A selectbox", ["A", 'B', "C"], 0)
multi = st.multiselect("A multiselect", ["A", 'B', "C"])