Penguin exercise

Hi,

I used pandas to load the data for penguin exercise. Using .head() I can see there are Culmen Length (mm) Culmen Depth (mm) and Species. But in the data opened with Numbers.app I can see there are more rows. Why in the exercise I can only see limited samples? Thanks

Hi @StevE_Ong,

The file ../datasets/penguins_classification.csv contains only the columns relevant to exercise M1.01 (Culmen Length (mm), Culmen Depth (mm) and Species).

If you want to access the other columns, you can load the file ../datasets/penguins.csv instead.
If you want to see more rows, you can pass a number of rows to the head method, or simply display the entire dataframe.

1 Like

To complete the answer from @Mirzon, you can refer to the documentation of pandas.DataFrame.head — pandas 1.2.4 documentation. By default, the parameter n=5 meaning the 5 first rows are shown. You can thus set this argument, e.g. df.head(n=10) to see the 10 first rows.

To know the exact number of rows, you can use for instance:

2 Likes