Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Working with Categorical Data in Python

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Print the category of the coat for ID 23807
print(dogs.loc[____, ____])
Code bewerken en uitvoeren