Exercise

Accessing and filtering data

You are working on a Python application to display information about the dogs available for adoption at your local animal shelter. Some of the variables of interest, such as "breed", "size", and "coat", are saved as categorical variables. In order for this application to work properly, you need to be able to access and filter data using these columns.

The ID variable has been set as the index of the pandas DataFrame dogs.

Instructions 1/4

undefined XP
  • 1
    • Print the "coat" value for the dog with an ID of 23807.
  • 2
    • For dogs with a long "coat", print the number of each "sex".
  • 3
    • Print the average age of dogs with a "breed" of "English Cocker Spaniel".
  • 4
    • Filter to the dogs with "English" in their "breed" name using the .contains() method.