Multiselect using multiple words (phrases or text)

I would like to use phrases to the user choose in the multiselect. However, I only manage to use single words.
I use it normally:
x = st.multiselect(“Choose to visualize”, df, df[‘phrase’][1:4])

I also tried to have sure to be string (I mean one big string, with: df[‘phrase’].values.astype(str)), but the error was the same “Every Multiselect default value must exist in options”

You can use a list and insert your phrases in the list. Below I included an example.

ex_ls=['your first phrase goes here','your second phrase goes here']

x = st.multiselect('Choose to visualize', ex_ls)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.