The previous recipes in this chapter showed how the .iloc and .loc indexers were used to select subsets of both Series and DataFrames in either dimension. A shortcut to select the rows exists with just the indexing operator itself. This is just a shortcut to show additional features of pandas, but the primary function of the indexing operator is actually to select DataFrame columns. If you want to select rows, it is best to use .iloc or .loc, as they are unambiguous.
Slicing rows lazily
Getting ready
In this recipe, we pass a slice object to both the Series and DataFrame indexing operators.