1. Learn
  2. /
  3. Courses
  4. /
  5. Anomaly Detection in Python

Exercise

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.

Instructions

100 XP
  • Create a boolean mask named is_lower that checks if the values of prices are less than lower_limit.
  • Create a boolean mask named is_higher that checks if the values of prices are greater than upper_limit.
  • Combine the masks and use boolean subsetting to filter for outliers.
  • Print the number of outliers found.