Skip to content

Label etiquettes #54963

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

Closed
1 of 3 tasks
tocr83 opened this issue Sep 2, 2023 · 2 comments
Closed
1 of 3 tasks

Label etiquettes #54963

tocr83 opened this issue Sep 2, 2023 · 2 comments
Labels
Enhancement Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@tocr83
Copy link

tocr83 commented Sep 2, 2023

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

I wish pandas would add an etiquette row below the column headers/label that can hold explanatory information about the specific column. For example on a housing dataset a column might hold a price variable and an etiquette that says price per sqm would be nice that gives the user an easy access to descriptive information as column headers are typically short. It can be thought of as a dict where each column header key can have a value etiquette.

Feature Description

Alternative Solutions

Additional Context

No response

@tocr83 tocr83 added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 2, 2023
@attack68
Copy link
Contributor

attack68 commented Sep 2, 2023

I don't really see how this is any different to either:

A)

Creating a table and adding that info into a meta object such as a dict as you say.

>>> meta = Series(
        ["Price paid for dwelling", "Living area m sq.", "Total area m sq."],
        index=["$", "L", "T"]
    )
>>> df = DataFrame([100, 25], columns=["$", "L"])
>>> meta.loc[df.columns]
Out[12]: 
$    Price paid for dwelling
L          Living area m sq.
dtype: object

B)

Using a MultiIndex.

>>> df.columns = MultiIndex.from_arrays([df.columns, meta.loc[df.columns]])
>>> df
                        $                 L
  Price paid for dwelling Living area m sq.
0                     100                25

Thus I don't really recognise any real benefit of adding your suggestion on top of the existing API, and think users would probably find it more of an obfuscation and confusing element, tbh.

@mroeschke
Copy link
Member

Thanks for the issue, but it appears this hasn't gotten traction in a while so closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

3 participants