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
msg="transform must return a scalar value for each group"
raiseValueError(msg) fromerr
This is calling _choose_path for every group, which in turn calls both the slow_path and the fast_path to determine if the fast path can be used. Indeed, running the code (from #41584):
Code in
groupby.generic.DataFrameGroupBy._transform_general
:pandas/pandas/core/groupby/generic.py
Lines 1299 to 1309 in b3e3352
This is calling
_choose_path
for every group, which in turn calls both the slow_path and the fast_path to determine if the fast path can be used. Indeed, running the code (from #41584):shows
myfirst
gets called 9 times - 3 times with columns x, 3 times with column y, and three times with the DataFrame consisting of x and y.Should we just be calling choose_path on the first group to determine which can be used?
cc @phofl @jbrockmendel
The text was updated successfully, but these errors were encountered: