Skip to content

DOC: Fixup CoW userguide #56636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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