Created
June 11, 2020 09:33
-
-
Save nikkisharma536/6c11559af2377be2346ec1c2d9060ebd to your computer and use it in GitHub Desktop.
Multi select widget with streamlit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Filters UI | |
subset_data = df | |
country_name_input = st.sidebar.multiselect( | |
'Country name', | |
df.groupby('Country/Region').count().reset_index()['Country/Region'].tolist()) | |
# by country name | |
if len(country_name_input) > 0: | |
subset_data = df[df['Country/Region'].isin(country_name_input)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment