Skip to content

ENH: df.columns returns list of series #57409

@R3dan

Description

@R3dan

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

Currently you can go df[{column label}] to access a column or df.columns to access the column labels. I propose either a new list that is like df.columns but with the series returned by df[{column}] or just replace df.columns with this new column. As long as you can access the label I don't see why not. This could also allow for adding or removinf new columns by editing df.columns

Feature Description

Completely new code could be needed or accessing the same as getitem does:

[i for i in indexes] with indexes being the columns.

Alternative Solutions

for i in df: column=df[i]

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closing CandidateMay be closeable, needs more eyeballsEnhancementIndexingRelated to indexing on series/frames, not to indexes themselvesNeeds InfoClarification about behavior needed to assess issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions