1. Learn
  2. /
  3. Courses
  4. /
  5. Python for MATLAB Users

Exercise

The many flavors of .iloc

There are multiple ways to index a pandas DataFrame – maybe too many. In this exercise, you're going to explore the many usages – or pitfalls of the .iloc indexer. This is something that will likely trip you up on your Python adventure, so it's good to know up front what you'll be up against.

Specifically, in this exercise, you'll learn to use .iloc in three slightly different ways that each return drastically different results.

Instructions 1/4

undefined XP
    1
    2
    3
    4
  • Use Python indexing on animals, and enter the first row index and the first column index into the brackets.