Adding edit and delete buttons to the end of a data frame

Summary

I am creating a Streamlit application that retrieves information from a Google Sheet into a pandas dataframe. I want a streamlit component that shows the dataframe table of information and then has buttons at the end of each row of data for Edit and Delete. With these buttons I want to go to a new page or dialog that allows me to edit the information contained within that row, or confirm Deletion of the row. Is this possible?

Hey @alt-luke

Welcome to our forum! :balloon:

I want a streamlit component that shows the dataframe table of information and then has buttons at the end of each row of data for Edit and Delete.

You should definitely check out our data editor in the docs! If you specify num_rows="dynamic" you will be able to have an editable number of rows, which should solve most of your questions. If you really want to move from an editable state to frozen state, you probably can have fun playing around with st.dataframe, st.data_editor and st.session_state

With these buttons I want to go to a new page or dialog that allows me to edit the information contained within that row, or confirm Deletion of the row.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.