Skip to content

Commit ece5d46

Browse files
committed
Updated docstring for copy() method
Added note that a copy with `deep=True` does not copy the data of objects contained in underlying arrays with `dtype=object`.
1 parent 28ba08c commit ece5d46

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/core/generic.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -2952,7 +2952,12 @@ def copy(self, deep=True):
29522952
Parameters
29532953
----------
29542954
deep : boolean or string, default True
2955-
Make a deep copy, i.e. also copy data
2955+
Make a deep copy, i.e. also copy data.
2956+
2957+
Note that when ``deep=True`` data is copied unless ``dtype=object``,
2958+
in which case only the reference to the object is copied. This is
2959+
in contrast to ``copy.deepcopy`` in the Standard Library, which
2960+
recursively copies object data.
29562961
29572962
Returns
29582963
-------

0 commit comments

Comments
 (0)