Open
Description
In groupby, agg may take various paths. While some branching may be necessary, this can lead to inconsistent results and should be avoided if possible. The following methods take different paths to do the main part of the computation. This issue is to investigate these methods and reduce branching if possible.
Once the deprecation in #7155 is enforced, the apply method does not branch in this fashion. A similar issue for transform is #42907.
DataFrameGroupBy.agg
- _python_agg_general
- _aggregate_frame
- DataFrameGroupBy.agg with func wrapped as a list
DataFrameGroupBy._python_agg_general
- _ptyhon_apply_general
- BaseGrouper.agg_series
cc @topper-123