Skip to content

Commit

Permalink
Backport PR pandas-dev#56636: DOC: Fixup CoW userguide
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored and meeseeksmachine committed Dec 27, 2023
1 parent 18aa834 commit 12ad8cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/source/user_guide/copy_on_write.rst
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ you are modifying one object inplace.
.. ipython:: python
df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
df2 = df.reset_index()
df2 = df.reset_index(drop=True)
df2.iloc[0, 0] = 100
This creates two objects that share data and thus the setitem operation will trigger a
Expand All @@ -328,7 +328,7 @@ held by the object.
.. ipython:: python
df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
df = df.reset_index()
df = df.reset_index(drop=True)
df.iloc[0, 0] = 100
No copy is necessary in this example.
Expand Down

0 comments on commit 12ad8cb

Please sign in to comment.