Boxplot showes incorrect picture

Question:

I have my code which shows stats:

data = data.assign(
    ArrDelay=np.where(data["ArrDelay"].lt(0), 0, data["ArrDelay"]),
    DepDelay=np.where(data["DepDelay"].lt(0), 0, data["DepDelay"])
)
data[["ArrDelay", "DepDelay"]].head(40)
data['Month'] = (data['ArrDelay'] + data['DepDelay'])

result = data.groupby("UniqueCarrier")["Month"].mean()
print(result)
sns.boxplot(x='UniqueCarrier', y='Month', data=data, order=result.index)

But the boxplot is incorrect.

There is my result:
enter image description here

How I’d like it to be:
enter image description here

Asked By: Eug

||

Answers:

you should remove the outliers with the showfliers option:

#... 
sns.boxplot(x='UniqueCarrier', y='Month', data=data, order=result.index, showfliers = False)
Answered By: Mat.B
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.