October 2019
Beginner to intermediate
674 pages
16h 43m
English
Integer-oriented indexing can be implemented for the same four cases as label-oriented indexing: single labels, a list of labels, range slicing, and Boolean arrays.
Let's use the same DataFrames as in the previous session to understand integer-oriented indexing. Here, let's use two values—one for each axis—to examine integer-based indexing. Passing an index for one axis is also permissible. This can also be done with the loc operator by passing in both the row and column labels:
# Indexing with single values.In: df_loc1.iloc[3, 2]Out: 18.0
# Indexing with list of indicesdf_loc1.iloc[[1, 4], [0, 2, 3]]

Read now
Unlock full access