Skip to content

Make individual columns editable #6221

@versus666jzx

Description

@versus666jzx

It would be cool if in the experimental data editor function it was possible to select only the necessary columns / keys for editing, since the data may contain critical values ​​that the user cannot change.

Usage example:

  • there is a boolean column in the data, the user will be able to mark only those lines with which he will continue to work without interfering with the data;
  • when importing tables, the user will be able to mark only the necessary columns for import without interfering with the data

etc.

Code example:

import streamlit as st
import pandas as pd

df = pd.DataFrame(
    [
       {"command": "st.selectbox", "rating": 4, "is_widget": True},
       {"command": "st.balloons", "rating": 5, "is_widget": False},
       {"command": "st.time_input", "rating": 3, "is_widget": True},
   ]
)
edited_df = st.experimental_data_editor(df, edit_columns=["is_widget"])

Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:st.data_editorRelated to the `st.data_editor` widgettype:enhancementRequests for feature enhancements or new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions