ENH: pandas.DataFrame.attrs #44689
Labels
Enhancement
metadata
_metadata, .attrs
Needs Discussion
Requires discussion from core team before further action
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.
The text was updated successfully, but these errors were encountered: