Skip to content

BUG: DataFrameGroupBy.__getitem__ should warn on tuple of length 1 #36302

Open
@rhshadrach

Description

@rhshadrach

Currently warnings are only emitted when the length of a tuple is greater than 1. From this comment in PR where the deprecation was implemented, there was some confusion as to the behavior of df.groupby('a')['b'] vs df.groupby('a')[('b', )]. The former is the SeriesGroupBy that the comment refers to where key is a string, the latter should still be deprecated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugGroupbyNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions