Skip to content

Commit 4507f3d

Browse files
committed
DOC: Add details to DataFrame groupby transform
Add requirements for user function in groupby transform closes #13543 [skip ci]
1 parent d98e982 commit 4507f3d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/core/groupby.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3531,6 +3531,13 @@ def transform(self, func, *args, **kwargs):
35313531
Each subframe is endowed the attribute 'name' in case you need to know
35323532
which group you are working on.
35333533
3534+
The current implementation imposes two requirements on f:
3535+
3536+
* f must return a new DataFrame - in-place mutation of subframes is
3537+
not supported and may produce unexpected results.
3538+
* f must support application both column-by-column and to the entire
3539+
subframe.
3540+
35343541
Examples
35353542
--------
35363543
>>> grouped = df.groupby(lambda x: mapping[x])

0 commit comments

Comments
 (0)