You will write a function for the two fences, a function that lists the outliers, and a function that gives the ends of the whiskers in a box plot that marks outliers.
The idea. The fences are and , with unless you choose another value. An outlier is beyond a fence. Each whisker ends at the most extreme value inside the fences.
Your tasks.
fences(data, k). Return the pair (low, high).outliers(data, k). Return a sorted list of the values beyond the fences.whiskers(data, k). Return the pair (smallest value inside the fences, largest value inside the fences).Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…