O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required