You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [8]: df=pd.DataFrame({"col": list("aab"), "val": range(3)})
In [8]: df.groupby("col").agg(["sum", "min"])
Out[8]:
valsummincola10b22In [9]: df.groupby("col").transform(["sum", "min"])
TypeError: 'list'objectisnotcallable
Feature Description
To get people out of the mindset of always using apply, it would be nice if .transform supported the same call signature as .agg
Additionally it would be great to support NamedAgg somehow in transform. The naming is a bit unfortunate...we could create a NamedTransform alias or maybe just live with the API inconsistency of:
I'm positive here, but there are potentially issues with agg and list-likes and we need to decide if we want to align to agg's behavior, or diverge from it. Namely, agg with a list-like will break up a DataFrame into Series first (even with a string like "sum"), and then operate on the Series.
@WillAyd@rhshadrach Hi guys, the GroupBy.transform repeat aggregate values for same number of rows like original DataFrame, as opposite to GroupBy.agg, that behaviour is to be kept right?
@WillAyd@rhshadrach Hi guys, the GroupBy.transform repeat aggregate values for same number of rows like original DataFrame, as opposite to GroupBy.agg, that behaviour is to be kept right?
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
Feature Description
To get people out of the mindset of always using apply, it would be nice if .transform supported the same call signature as .agg
Additionally it would be great to support NamedAgg somehow in transform. The naming is a bit unfortunate...we could create a NamedTransform alias or maybe just live with the API inconsistency of:
I think either is still a net improvement over today
Alternative Solutions
n/a
Additional Context
No response
The text was updated successfully, but these errors were encountered: