I wanted to make a dropdown that contain values from the response of a SQL query, it contains more than 35000 rows and its should searchable and selectable in a dropdown and based on that i want another dropdown to appear with a different query, i am very new to streamlit just wanted to know if this is possible, since this is a huge amount of data from SQL response
The quick solution here is instead of passing in advertiser_data to the selectbox, pass in advertiser_data["name"], so that the pandas Series is passed to the selectbox.
Separately, you might run into issues with having 35,000 rows in a drop-down. It’s not really a strong user experience either…is there a way you can do the top 1000 by occurrence, or have multiple drop-downs for people to hone in on which advertiser they are interested in?
Thanks @randyzwitch, advertiser[“name”] worked to pull advertiser_data without index and also in the format of rows, and as you suggested i tried dividing the rows of advertiser into smaller chunks using below code, but it not working, the get_advertisers() keeps on running without sending an data to streamlit, and in my case its not possible to have multiple dropdowns for people.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.