If I have a data frame df
and want to select multiple rows.
Using .iloc
I can do df.iloc[1:8]
, but doing the same using .loc
requires either doing
df.loc[1:8]
or
df.loc[[1,2,3,4,5,6,7,]]
I am curious to know about the reasoning behind the double brackets for the. loc