Hello, Penguins!

Published

October 23, 2023

Introduction

Meet the Palmer Penguins!!

Packages

For this analysis we’ll use a few packages for visualization and data display.

Code
import pandas as pd
import seaborn as sns 
from IPython.display import Markdown

sns.set_style('whitegrid')

Data

The dataset we’ll use comes from the palmerpenguins package.

Code
from palmerpenguins import load_penguins

penguins = load_penguins()

This dataset contains size measurements, clutch observations, and blood isotope ratios for 344 adult foraging Adélie, Chinstrap, and Gentoo penguins observed on islands in the Palmer Archipelago near Palmer Station, Antarctica.(Gorman, Williams, and Fraser 2014)

Three species of penguins

Three species of penguins

Let’s take a peek at the data. Table 1 shows the first five rows of the penguins data frame.

Code
Markdown(penguins.head().to_markdown(index=False))
Table 1: First five rows of the penguins data frame.
species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g sex year
Adelie Torgersen 39.1 18.7 181 3750 male 2007
Adelie Torgersen 39.5 17.4 186 3800 female 2007
Adelie Torgersen 40.3 18 195 3250 female 2007
Adelie Torgersen nan nan nan nan nan 2007
Adelie Torgersen 36.7 19.3 193 3450 female 2007

Exploratory analysis

Body mass vs. flipper length

Figure 1 shows the relationship between body mass and flipper length of penguins.

Code
# from https://github.com/mcnakhaee/palmerpenguins
g = sns.lmplot(x="flipper_length_mm",
               y="body_mass_g",
               hue="species",
               height=7,
               data=penguins,
               palette=['#FF8C00','#159090','#A034F0'])
g.set_xlabels('Flipper Length (mm)')
g.set_ylabels('Body Mass (g)')
Body mass vs. flipper length of three species of penguins (Adelie, Gentoo, and Chinstrap) showing a positive relationship between the two variables for each species.
Figure 1: Body mass vs. flipper length of penguins

References

Gorman, Kristen B, Tony D Williams, and William R Fraser. 2014. “Ecological Sexual Dimorphism and Environmental Variability Within a Community of Antarctic Penguins (Genus Pygoscelis).” PloS One 9 (3): e90081.