Skip to content

Commit f3ff720

Browse files
author
pdpark
committed
Doc: Add warning message to treat group chunks as immutable
Resolves: pandas-dev#14180
1 parent 12e509b commit f3ff720

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

doc/source/groupby.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -944,13 +944,16 @@ that is itself a series, and possibly upcast the result to a DataFrame:
944944
So depending on the path taken, and exactly what you are grouping. Thus the grouped columns(s) may be included in
945945
the output as well as set the indices.
946946

947-
.. warning::
948947

949-
In the current implementation apply calls func twice on the
948+
* In the current implementation apply calls func twice on the
950949
first group to decide whether it can take a fast or slow code
951950
path. This can lead to unexpected behavior if func has
952951
side-effects, as they will take effect twice for the first
953952
group.
953+
954+
* Apply should not perform in-place operations on the group chunk.
955+
Group chunks should be treated as immutable, and changes to a
956+
group chunk may produce unexpected results.
954957

955958
.. ipython:: python
956959

0 commit comments

Comments
 (0)