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
A common issue [citation needed] comes up in groupby.apply when a user passes a function that modifies its argument in-place. This is because we call the function on the first group first to see if we can use a fastpath, and then again when we apply it to all groups.
We could add a kwarg to specify if a function may mutate its data, e.g. gb.apply(myfunc, may_mutate=True) in which case we could avoid re-calling the function (probably means no fast-path). With may_mutate=False we could use a context in which we set the data's flags to be immutable before calling anything on it.
The text was updated successfully, but these errors were encountered:
A common issue [citation needed] comes up in groupby.apply when a user passes a function that modifies its argument in-place. This is because we call the function on the first group first to see if we can use a fastpath, and then again when we apply it to all groups.
We could add a kwarg to specify if a function may mutate its data, e.g.
gb.apply(myfunc, may_mutate=True)
in which case we could avoid re-calling the function (probably means no fast-path). Withmay_mutate=False
we could use a context in which we set the data's flags to be immutable before calling anything on it.The text was updated successfully, but these errors were encountered: