Skip to content

Commit 0cb2ca1

Browse files
phoflcbpygit
authored andcommitted
DOC: Fixup CoW userguide (pandas-dev#56636)
1 parent b5979bc commit 0cb2ca1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/source/user_guide/copy_on_write.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ you are modifying one object inplace.
317317
.. ipython:: python
318318
319319
df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
320-
df2 = df.reset_index()
320+
df2 = df.reset_index(drop=True)
321321
df2.iloc[0, 0] = 100
322322
323323
This creates two objects that share data and thus the setitem operation will trigger a
@@ -328,7 +328,7 @@ held by the object.
328328
.. ipython:: python
329329
330330
df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
331-
df = df.reset_index()
331+
df = df.reset_index(drop=True)
332332
df.iloc[0, 0] = 100
333333
334334
No copy is necessary in this example.

0 commit comments

Comments
 (0)