Skip to content

Commit 2954d07

Browse files
committed
DOC: improve clarity of Copy-on-Write explanation
1 parent ff1e706 commit 2954d07

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/core/generic.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6542,17 +6542,17 @@ 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, 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
6545+
and index are copied). With Copy-on-Write, changes to the original
6546+
will *not* be reflected in the shallow copy (and vice versa). The
6547+
shallow copy uses a lazy (deferred) copy mechanism that copies the
65486548
data only when any changes to the original or shallow copy are made,
65496549
ensuring memory efficiency while maintaining data integrity.
65506550
65516551
.. note::
65526552
In pandas versions prior to 3.0, the default behavior without
6553-
Copy-on-Write was different: changes to the data of the original
6554-
*were* reflected in the shallow copy (and vice versa). See the
6555-
:ref:`Copy-on-Write user guide <copy_on_write>` for more information.
6553+
Copy-on-Write was different: changes to the original *were* reflected
6554+
in the shallow copy (and vice versa). See the :ref:`Copy-on-Write
6555+
user guide <copy_on_write>` for more information.
65566556
65576557
Parameters
65586558
----------

0 commit comments

Comments
 (0)