Exercise

Penguin plotting in chain

Combining plots for multiple groups allows you to compare qualities within and between those groups. Now let's combine it with the macro experience! In this exercise, you'll be looking at three different species of penguins, Adelie, Chinstrip, and Gentoo. Your colleagues think it might be possible to successfully infer the species by comparing the lengths of their flippers and their body mass. Let's see if they are right!

The penguins DataFrame has been imported for you, along with all the necessary packages.

Instructions

100 XP
  • Inside the macro, group the penguins DataFrame by the species column.
  • Create a scatter plot of the flipper_length_mm against the body_mass_g columns for the different groups, using the provided labels. You can use gdf[1] to access the first group of the gdf GroupedDataFrame.
  • Remember to plot all the species into a single plot.