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: Passing a dictionary to SeriesGroupBy.agg #52268

Merged
merged 5 commits into from
Mar 31, 2023

Conversation

rhshadrach
Copy link
Member

@rhshadrach rhshadrach added Groupby Deprecate Functionality to remove in pandas Apply Apply, Aggregate, Transform, Map labels Mar 29, 2023
@rhshadrach
Copy link
Member Author

I don't see a feasible way to use a single template for both SeriesGroupBy.agg and DataFrameGroupBy.agg, so I split it into two. Is there one, or should these be split?

@rhshadrach rhshadrach requested a review from mroeschke March 29, 2023 03:16
- function
- string function name
- list of functions and/or function names, e.g. ``[np.sum, 'mean']``
- dict of axis labels -> functions, function names or list of such.
Copy link
Member

@mroeschke mroeschke Mar 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this line specifically because passing dicts here is being deprecated?

Copy link
Member Author

@rhshadrach rhshadrach Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For most cases, my preference would be to have the User Guide reflect how we would like users to use pandas (so deprecations are to be removed) and the API docs to be an accurate reflection of the current arguments/behavior (so deprecations should not be removed). If there are other opinions here, maybe we should make an issue to discuss.

However, in this case dict already doesn't work for SeriesGroupBy.agg when as_index=True (the default), so this one is a bit of a grey area. I'm good with removing here and will update.

@mroeschke mroeschke added this to the 2.1 milestone Mar 31, 2023
@mroeschke mroeschke merged commit fe09ace into pandas-dev:main Mar 31, 2023
@mroeschke
Copy link
Member

Thanks @rhshadrach

@rhshadrach rhshadrach deleted the depr_sgb_agg_dict branch March 31, 2023 18:13
topper-123 pushed a commit to topper-123/pandas that referenced this pull request Apr 1, 2023
* DEPR: Passing a dictionary to SeriesGroupBy.agg

* fixup

* Remove dict, fixup

* fixup frame docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform, Map Deprecate Functionality to remove in pandas Groupby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: SeriesGroupBy.agg with dict argument
2 participants