I am not looking for ready made code, I am just curios if the streamlit library has the capability to collape/expand some rows based on an identifier.
My data consists of multiple rows with entries that detail purchases of an item at different price points and dates. I want to see a “summarize” row that consists of a sum of all item quantities and an average or the purchase price - this row I can create through python or maybe streamlit could create it automatically. Once I have this row, if I click it I want to see all item purchases, then if I click it again I want to see just the summarize row.
My question is: is there such a capability built in streamlit and if it is can you please tell me what I should look into?
You would need to handle the logic yourself as there aren’t built-in summarizing features like that. If I were to make something as you describe I’d probably put together the following pieces:
Based on the output of st.data_editor, I’d gather the additional data into one or more st.dataframe displays below it.
I’m not deeply familiar with streamlit_aggrid which is an add-on for Streamlit. I think it has some ability to do a summary row, but I’m not sure if it will serve your use case. Still, you might check that out.
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.