Selecting rows of a DataFrame
Rows can be retrieved via an index label value using .loc[]:
Furthermore, multiple rows can be retrieved using a list of labels:
Rows can be retrieved by location using .iloc[]:
It is possible to look up the location in the index of a specific label value and then use that value to retrieve the row by position:
As a final note in this section, these operations are also possible using .ix[]. However, this has been deprecated. For more details, see http://pandas.pydata.org/pandas-docs/stable/indexing.html#different-choices-for-indexing.