Hi All,
I’m encountering an issue where I can’t set a default value on a multiselect dropdown when the options are coming from a pandas dataframe.
The following works without a problem:
options = st.multiselect(
"What are your favorite colors",
["Green", "Yellow", "Red", "Blue"],
default=["Yellow"]
)
But when i use a series to fill the labels I get an error:
names = pd.DataFrame({'labels':["Green","Yellow","Red","Blue"]})
nameSelect = st.multiselect(
"What are your favorite colors",
names['labels'],
default=["Yellow"],
)
I get the following error:
StreamlitAPIException : Every Multiselect default value must exist in options
Is this fixable on my end? Thanks in advance for your help!