Skip to content

ENH: pandas.DataFrame.attrs #44689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
shruti-ramaiya opened this issue Nov 30, 2021 · 1 comment
Open

ENH: pandas.DataFrame.attrs #44689

shruti-ramaiya opened this issue Nov 30, 2021 · 1 comment
Labels
Enhancement metadata _metadata, .attrs Needs Discussion Requires discussion from core team before further action

Comments

@shruti-ramaiya
Copy link

shruti-ramaiya commented Nov 30, 2021

Is your feature request related to a problem?

I am working on a large project which involves the use of pandas data frames throughout. Due to this, I need to be able to assign string names to data frames and call upon them (and ideally other attributes too which depend on the DataFrame in question e.g. colour etc.). For now I have been able to do so using 'pandas.DataFrame.attrs' which has worked perfectly. However, on the documentation page it says that this may be subject to change without prior warning and therefore I am hesitant to use it in such a large project as if it does change, it will cause major issues.

Describe the solution you'd like

I was therefore wondering if there was the possibility of making this a permanent feature of pandas as it (extremely usefully) allows attributes to be assigned to data frames and called upon easily when the DataFrame in question is being 'used' per say.

Describe alternatives you've considered

Alternatives could be if there is another, more 'secure' way to replicate what 'pandas.DataFrame.attrs' does or even the possibility of creating a way to allow easier assignment of string names (and other attributes) to data frames.

Any help/insight is greatly appreciated.

EDIT: Assigning DataFrame string names and attributes is also a common request on StackOverflow and as far as I have seen, there are no 'easy' or simple ways around this other than the 'attrs' method above so I believe this would be an extremely helpful and widely used feature of pandas if it were to be made available permanently.

Thank you.

@shruti-ramaiya shruti-ramaiya added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Nov 30, 2021
@jbrockmendel
Copy link
Member

This is likely to retain the experimental status until the kinks are worked out of it, xref #28283

@mroeschke mroeschke added metadata _metadata, .attrs Needs Discussion Requires discussion from core team before further action and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement metadata _metadata, .attrs Needs Discussion Requires discussion from core team before further action
Projects
None yet
Development

No branches or pull requests

3 participants