Skip to content

Commit 406049e

Browse files
maximesongmaxime.song
and
maxime.song
authored
DOC: fix code snippets for generic indexing (#35175)
Co-authored-by: maxime.song <[email protected]>
1 parent 8295dc4 commit 406049e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/source/user_guide/cookbook.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ There are 2 explicit slicing methods, with a third general case
219219
df.loc['bar':'kar'] # Label
220220
221221
# Generic
222-
df.iloc[0:3]
223-
df.loc['bar':'kar']
222+
df[0:3]
223+
df['bar':'kar']
224224
225225
Ambiguity arises when an index consists of integers with a non-zero start or non-unit increment.
226226

0 commit comments

Comments
 (0)