Skip to content

Commit ff1e706

Browse files
committed
DOC: improve clarity of Copy-on-Write
1 parent 2fa4bbd commit ff1e706

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pandas/core/generic.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6542,12 +6542,11 @@ def copy(self, deep: bool = True) -> Self:
65426542
65436543
When ``deep=False``, a new object will be created without copying
65446544
the calling object's data or index (only references to the data
6545-
and index are copied). With Copy-on-Write enabled by default,
6546-
changes to the data of the original will *not* be reflected in the
6547-
shallow copy (and vice versa). The shallow copy uses a lazy (deferred)
6548-
copy mechanism that copies the data only when any changes to the
6549-
original or shallow copy are made, ensuring memory efficiency while
6550-
maintaining data integrity.
6545+
and index are copied). With Copy-on-Write, changes to the data of the
6546+
original will *not* be reflected in the shallow copy (and vice versa).
6547+
The shallow copy uses a lazy (deferred) copy mechanism that copies the
6548+
data only when any changes to the original or shallow copy are made,
6549+
ensuring memory efficiency while maintaining data integrity.
65516550
65526551
.. note::
65536552
In pandas versions prior to 3.0, the default behavior without

0 commit comments

Comments
 (0)