Skip to content

GroupBy Doesn't Always Maintain Column Index Name #29764

Closed
@WillAyd

Description

@WillAyd

Just as a follow up to #29124 discovered during #29753 - looks like the column name is dropped for any/all and transformation functions in groupby

>>> df = pd.DataFrame([[1]], columns=pd.Index(["a"], name="idx"))
>>> df.groupby([1]).sum()
idx  a
1    1
>>> df.groupby([1]).any()
      a
1  True
>>> df.groupby([1]).shift()
    a
0 NaN

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions