# Do outliers begin from or above the whisker-limit? [duplicate]

Does outliers begin on the whisker limit or above it?

In the (Python) example below the calculcated upper whisker limit is 64.8125. Is a value of 64.8125 an outlier (>= upper_limit)? Or the outliers are higher then the limit (> upper_limit)?

>>> import seaborn as sns
>>> df = sns.load_dataset('titanic)

>>> df.age.quantile([.25, .5, .75])
0.25    20.125
0.50    28.000
0.75    38.000
Name: age, dtype: float64

>>> q1, q2, q3 = df.age.quantile([.25, .5, .75])
>>> iqr = q3 - q1
>>> whisker_length = iqr * 1.5

>>> upper_limit = q3 + whisker_length
>>> lower_limit = q1 - whisker_length
>>> lower_limit, upper_limit
(-6.6875, 64.8125)

• Apr 18, 2023 at 9:11
• No it don't because it doesn't fit to my MWE. Apr 18, 2023 at 11:40
• What is an "MWE" and why should it matter here? BTW, I found the duplicate threads by searching for "boxplot fence" and "boxplot whisker outlier" and looking at the top-voted hits. I'm sure you can find even more answers by searching further.
– whuber
Apr 18, 2023 at 13:00
• Apr 18, 2023 at 14:04
• I thought it might be that, but your example is by no means "minimal."
– whuber
Apr 19, 2023 at 15:32

## 1 Answer

Under Tukey's approach, the whiskers are specifically drawn in each direction to the furthest observation from the median that is still within (or equal to) the inner fence. If a point is exactly on the inner fence, the whisker includes it.

A marked point must therefore be outside the inner fences.

That is strictly above on the high side (above the upper inner fence) but strictly below on the low side (below the lower inner fence).

Here's an illustration where there's points above the upper inner fence.

• Can you please fit your answer to my MWE and give a number. Apr 18, 2023 at 8:51
• No. ... That looks like I'd be doing homework. I believe my answer is unambiguous. Apr 18, 2023 at 8:52
• I'm far behind homework. I just try to "translate" it into my world. I know Tukey of course. But I don't "speak" math. Also English isn't my nativ language. So I just want to be sure if I understand it correct. My assumption is > upper_limit but I'm not sure without confirmation based on my MWE. Apr 18, 2023 at 9:45