DEPR: make Series.agg aggregate when possible by topper-123 · Pull Request #53325 · pandas-dev/pandas (original) (raw)
The doc string for Series.agg
says: "A passed user-defined-function will be passed a Series for evaluation."
which isn't true currently. In addition, Series.agg
currently will not always aggregate, when given a aggregation function. This PR fixes those issues.
It can be noted that both the behavior and that doc string are correct for DataFrame.agg
, so this PR aligns the behavior of Series.agg
and DataFrame.agg
.
I'm not sure if this is too drastic as a bug fix, or we want it as part of a deprecation process, but just putting this up there, will see where it goes.
EDIT: In the new version the old behavior is deprecated rather than just removed.