Palmer Penguins#
Body measurements of 344 penguins of three species, observed on three islands of the Palmer Archipelago in Antarctica between 2007 and 2009. It is a friendly alternative to Iris, and the first dataset here with missing values and categorical features, which makes it a good place to practise imputation and encoding.
Overview#
Loader |
|
Task |
Classification |
Samples |
344 |
Features |
7 |
Targets |
3 classes: |
Missing values |
19 values in 5 columns, stored as |
License |
CC0 1.0 |
Features#
island and sex are categorical and stored as integer codes, the names of the
categories are in data.info.categorical. bill_length_mm, bill_depth_mm,
flipper_length_mm, body_mass_g and year are numbers. Missing values are NaN.
Use data.categorical_features to find the categorical columns.
Target#
y is the species: 0 for Adelie (152 penguins), 1 for Chinstrap (68) and 2 for Gentoo
(124). The target has no missing values.
Source and citation#
Source: palmerpenguins data package (Palmer Station Antarctica LTER and K. Gorman)
Obtained from: The file inst/extdata/penguins.csv of the GitHub repository allisonhorst/palmerpenguins, tag v0.1.0. Its SHA-256 digest is pinned in the build recipe.
Creators: Allison Marie Horst, Alison Presmanes Hill, Kristen B Gorman
Please cite the dataset as:
Horst AM, Hill AP, Gorman KB (2020). palmerpenguins: Palmer Archipelago (Antarctica) penguin data. R package version 0.1.0. https://allisonhorst.github.io/palmerpenguins/. doi:10.5281/zenodo.3960218.
See also:
Gorman KB, Williams TD, Fraser WR (2014). Ecological sexual dimorphism and environmental variability within a community of Antarctic penguins (genus Pygoscelis). PLoS ONE 9(3):e90081. https://doi.org/10.1371/journal.pone.0090081
Adelie data record: https://doi.org/10.6073/pasta/98b16d7d563f265cb52372c8ca99e60f
Gentoo data record: https://doi.org/10.6073/pasta/7fca67fb28d56ee2ffa3d9370ebda689
Chinstrap data record: https://doi.org/10.6073/pasta/c14dfcfada8ea13a17536e73eb6fbe9e
License#
CC0 1.0, as stated by the source. The license was checked at the source on 2026-10-17. See License and citation.
Changes made#
Converted to the NumPy NPZ format. Measurements are stored as float64 and the species as int64 labels (0 = Adelie, 1 = Chinstrap, 2 = Gentoo).
The columns island and sex are stored as integer codes, see the categorical features. The missing values (NA in the CSV file) are stored as NaN.
All columns except the species are features. No row and no column was removed.
Note
The data are released under CC0. The package page also asks anyone who wants to publish with the data to contact its creator about the analysis and final products, and expects users to follow the US LTER Network Data Access Policy.
Example#
>>> import numpy as np
>>> from pyml_datasets import load_penguins
>>> data = load_penguins()
>>> data.X.shape
(344, 7)
>>> data.has_missing, int(np.isnan(data.X).sum())
(True, 19)
>>> data.categorical_features
(0, 5)
>>> data.info.categorical["sex"]
('female', 'male')