Open
Description
Issues where agg
is used with non-reducing functions:
- Behavior of new df.agg, df.transform and df.apply is very inconsistent #18103
- groupby agg with rank and parameter return does not reduce #14741
- BUG: DataFrame.agg with multiple cum functions creates wrong result #35490
I think agg
should raise if the function(s) provided are not reducers. This can be tested by if the resulting index is equal to always reduce regardless of the return value. That is, treat the result of the UDF as if it a scalar (even when it's not).self.grouper.result_index
.