Both .loc and .iloc work with Series and DataFrames. This recipe shows how to select Series data by integer location with .iloc and by label with .loc. These indexers not only take scalar values but also lists and slices.
Both .loc and .iloc work with Series and DataFrames. This recipe shows how to select Series data by integer location with .iloc and by label with .loc. These indexers not only take scalar values but also lists and slices.