Exercise

Boolean indexing for quick stats

Let's return to the animals dataset, which is loaded as a list of dictionaries. You're going to use all you've learned and transform this data into a useable DataFrame, filter the data using Boolean indexing, and then perform some numpy magic to find out some interesting animal facts.

Instructions

100 XP
  • Create a DataFrame animals from the list of dictionaries animals.
  • Create a Boolean index mammals by finding records where the "Class" is "Mammalia".
  • Create a Boolean index birds by finding records where the "Class" is "Aves".
  • Use numpy to find the mean of the "Litter/Clutch size" column for mammals and birds.