How to create a column based in other column in st.dataframe?

Summary

Hi, I have an app that uses a st.dataeditor and I want to create a column with values based in the values of other columns, like streamlit-aggrid virtual columns, when if you change the value in “a” or “b”. the value in the virtual column will change too.

I tried to use st-aggrid, but i got so many bugs and the project seems stopped.

Here’s one way to do it with st.data_editor

1 Like

Nice. And is possible to achieve that without rerunning the entire app, just the table?

No, not currently. Theoretically that could be added to the st.dataframe functionality in the future, but otherwise you would need to use a third-party component with some custom javascript to enable that.

Understood. That functionality is in the plans for future releases?

Not that I know of, but you’re definitely welcome to suggest it in Issues · streamlit/streamlit · GitHub (if you can’t find an existing issue suggesting it)

You can see the current roadmap here: Issues · streamlit/streamlit · GitHub

Just added a issue here:
Create virtual columns in data editor (columns based on other columns) #7057

1 Like

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