The most explicit and preferred way to select DataFrame rows is with the .iloc and .loc indexers. They are capable of selecting rows or columns independently and simultaneously.
Selecting DataFrame rows
Getting ready
This recipe shows you how to select rows from a DataFrame using the .iloc and .loc indexers.
How to do it...
- Read in the college dataset, and set the index as the institution name:
>>> college = pd.read_csv('data/college.csv', index_col='INSTNM')
>>> college.head()
- Pass an integer to the .iloc indexer to select an entire...