pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more

Home Page:https://pandas.pydata.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make specific pandas dataframe column immuteable / not changeable

weidinger-c opened this issue · comments

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

I would be really helpful if specific columns cannot be altered.

Feature Description

I have a lib that returns a pd.dataframe but only a few columns are allowed to be altered. Just dropping the not allowed columns does not solve the problem, because they are needed at a later point.

Alternative Solutions

e.g.
df = pd.Dataframe(...)
df.make_column_immutable("column_name")

Additional Context

No response

Thanks for the request. I don't think this feature meets the bar of being a common enough need to be implemented within pandas.

Sad to hear.

Agreed with this being out of scope in pandas. As a work around you could use the static-frame package to segment the columns that need to be immutable: https://github.com/static-frame/static-frame.

Thanks for the request but closing

Agreed with this being out of scope in pandas. As a work around you could use the static-frame package to segment the columns that need to be immutable: https://github.com/static-frame/static-frame.

Thanks for the request but closing

Thanks, willl have a look at that package.