Skip to content
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

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

Open
rhshadrach opened this issue Mar 6, 2024 · 2 comments
Open

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

rhshadrach opened this issue Mar 6, 2024 · 2 comments
Labels
Deprecate Functionality to remove in pandas Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Reduction Operations sum, mean, min, max, etc.
Milestone

Comments

@rhshadrach
Copy link
Member

#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())
@rhshadrach rhshadrach added Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Deprecate Functionality to remove in pandas Reduction Operations sum, mean, min, max, etc. labels Mar 6, 2024
@rhshadrach rhshadrach added this to the 4.0 milestone Mar 6, 2024
@jbrockmendel
Copy link
Member

Make this a breaking change in 3.0? Could do a full deprecation cycle, but the inconsistency will be annoying in the interim.

@rhshadrach
Copy link
Member Author

That sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Reduction Operations sum, mean, min, max, etc.
Projects
None yet
Development

No branches or pull requests

2 participants