Skip to content

DEPR: groupby.idxmin/idxmax will all NA values #57745

Open
@rhshadrach

Description

@rhshadrach

#54234 deprecated the case of skipna=False and any NA value, but for consistency with Series/DataFrame versions, we also want the case of skipna=True with all NA values in a group to also raise. E.g. this should raise a ValueError

df = pd.DataFrame({'a': [1, 1, 2], 'b': np.nan})
gb = df.groupby("a")
print(gb.idxmin())

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeprecateFunctionality to remove in pandasGroupbyMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateReduction Operationssum, mean, min, max, etc.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions