Premium problem121. Outliers by the 1.5 IQR Rule

Medium Locked

df has a numeric column value.

Return the rows that fall outside the usual fences: below Q1 - 1.5 * IQR or above Q3 + 1.5 * IQR, where IQR = Q3 - Q1 and the quartiles use pandas' default linear interpolation. Keep the original columns and index order.

Input

   id  value
0   1   10.0
1   2   11.0
2   3   12.0
3   4   13.0
4   5   14.0
5   6   15.0
6   7   16.0
7   8  200.0

Output

   id  value
7   8  200.0

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)