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
Essentially, there are cases now where the agg or transform or apply function is applied to the grouper. This can cause failures in some very odd ways. As a simple example:
In [25]: df=pd.DataFrame({"A": ['a', 'b', 'a', 'b'], 'B': [1, 2, 3, 4]})
In [26]: dfOut[26]:
AB0a11b22a33b4
[4rowsx2columns]
In [28]: df.groupby('A').apply(lambdax: x+1)
TypeError: Couldnotoperate1withblockvaluescannotconcatenate'str'and'int'objects
The example in the SO post linked above is especially subtle because the path the code follows depends on whether or not the aggfunc is successfully applied to the grouping column.
I'm going to poke around the code and see what breaks. I'd propose that we apply the function to the grouper in fewer (possibly zero) cases.
The text was updated successfully, but these errors were encountered:
This came up in #5264, especially here, here, and this SO post.
Essentially, there are cases now where the
agg
ortransform
orapply
function is applied to the grouper. This can cause failures in some very odd ways. As a simple example:The example in the SO post linked above is especially subtle because the path the code follows depends on whether or not the aggfunc is successfully applied to the
group
ing column.I'm going to poke around the code and see what breaks. I'd propose that we apply the function to the grouper in fewer (possibly zero) cases.
The text was updated successfully, but these errors were encountered: