Hi everyone, I have a problem. I created a button for clear multiselects, but when I run the button, it creates new multiselect with errased filters, I don’t want to create new multiselect filters I only want to clean old filters multiselect. In the next section, you can see the link to my code and then you can see the specific part with the button.
I appreciate your comments!
- Specific code part:
if st.sidebar.button(“Limpiar filtros”):
genero = st.sidebar.multiselect(
"Seleccionar Genero: ",
options=df_violencia_int_2023[‘GENERO’].unique(),
)
agrupacion_edad = st.sidebar.multiselect(
label='Seleccione Grupo Etario',
options=df_violencia_int_2023['AGRUPA_EDAD_PERSONA'].unique(),
)
departamento = st.sidebar.multiselect(
label='Seleccione departamento',
options=df_violencia_int_2023['DEPARTAMENTO'].unique(),
)
mpio = st.sidebar.multiselect(
label='Seleccione municipio',
options=df_violencia_int_2023['MUNICIPIO'].unique(),
)