[Python] Streamlit multiselect, if I don't select anything, doesn't show data frame

Discussão em 'Python' iniciado por Stack, Janeiro 31, 2025.

  1. Stack

    Stack Membro Participativo

    I am building a Streamlit app. Part of my code includes multiselect as follows, when I dont select anything in multiselect, I want to show whole data frame without any filtration, but it doesn't show any data, how should I modify the code?

    code_= df_temp.CODE.unique().tolist()
    type_ = df_temp.TYPE.unique().tolist()

    options, options2 = st.columns([0.1, 0.1])

    options = options.multiselect('Select Code', code_ )
    options2 = options2.multiselect('Select Type', type_ )

    df_filtered = time_filtered.query('CODE in @options or TYPE in @options2')

    Continue reading...

Compartilhe esta Página