LoslegenKostenlos loslegen

Accessing rows and columns

While your typical DataFrame may contain hundreds, thousands, and maybe even millions of rows, sometimes you'll just want to explore your data bit-by-bit. This will often mean focusing on one row to get a picture of all the data available for a given set of your data. It may also mean viewing a column to get a picture of the available values.

In this exercise, you'll explore your wild side by accessing rows and columns in the animals DataFrame in a few different ways.

Use the .index and .columns attributes on animals in the console to get a sneak peek at the data.

Diese Übung ist Teil des Kurses

Python for MATLAB Users

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Access the Narwhal row
print(animals.loc['____'])
Code bearbeiten und ausführen