question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select All Feature in st.selectbox

See original GitHub issue

I am attempting to plot a scatter plot using altair on streamlit.

I am having trouble with the selectbox which contains each US state. Before touching the selectbox all the states are displayed on the chart, however when I choose one specific state to focus on using selectbox I can’t go back to select all unless I remove the dropdown the page. Is there a way I can select all values using a dropdown with having to do it manually using multiselect?

states_list = list(df_w.State.unique())
state_dropdown = st.sidebar.selectbox('State',states_list)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
DhruvkBhattcommented, Nov 13, 2020
import streamlit as st

states_list = ['Alabama','New York','Texas','Washington']
l2=[]
l2=states_list[:]
l2.append('Select all')
state_dropdown = st.multiselect('State',l2)

if 'Select all' in state_dropdown :
	state_dropdown=states_list
	
st.write(state_dropdown)
1reaction
DhruvkBhattcommented, Nov 4, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

'Select All' on a Streamlit Multiselect
Hi all, I've been trying to get a “Select All” checkbox to work on a multiselect widget by doing the following: if st.checkbox('Select ......
Read more >
How to use the streamlit.selectbox function in streamlit - Snyk
To help you get started, we've selected a few streamlit.selectbox examples, based on popular ways it is used in public projects.
Read more >
Select multiple options in checkboxes in Streamlit
I have tried with the dropdown feature of multiselect . import streamlit as st option = st.multiselect('Select three known variables:', [' ...
Read more >
Streamlit Shorts: How to make a select box - YouTube
In this video, you'll learn how to use the st. selectbox command, which displays a selection widget for users to choose from a...
Read more >
A Beginners Guide To Streamlit - GeeksforGeeks
The multi-select box returns the output in the form of a list. You can select multiple options. Python3. Python3 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found