pd.DataFrame.iloc
¶
pandas.DataFrame.iloc
getitem¶
df.iloc
supports single integer indexing (returns row as series)df.iloc[0]
df.iloc
supports single list/array/series of integers/booldf.iloc[[0,1,2]]
- for tuples indexing
df.iloc[row_idx, col_idx]
we allow:row_idx
to be int list/array/series of integers/bool slicecol_idx
to be constant int, constant list of integers, or constant slice
- e.g.:
df.iloc[[0,1,2], :]
setitem¶
df.iloc
only supports scalar setitemdf.iloc
only supports tuple indexingdf.iloc[row_idx, col_idx]
row_idx
can be anything supported for series setitem:- int
- list/array/series of integers/bool
- slice
col_idx
can be: constant int, constant list/tuple of integers