Using outlier limits for filtering
In the previous exercise, you found the limits you will use for categorizing outliers. In this exercise, you'll apply them to the prices distribution to isolate the outliers.
The prices, lower_limit, and upper_limit variables are available from the last exercise.
Deze oefening maakt deel uit van de cursus
Anomaly Detection in Python
Oefeninstructies
- Create a boolean mask named
is_lowerthat checks if the values of prices are less thanlower_limit. - Create a boolean mask named
is_higherthat checks if the values of prices are greater thanupper_limit. - Combine the masks and use boolean subsetting to filter for outliers.
- Print the number of outliers found.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Create a mask for values lower than lower_limit
is_lower = ____
# Create a mask for values higher than upper_limit
is_higher = ____
# Combine the masks to filter for outliers
outliers = ____[____]
# Count and print the number of outliers
____