我有一个名为 a 的 Pandas 系列,a.describe() 给出了这个
count 1116.000
mean 211.495
std 1241.612
min 1.000
25% 16.000
50% 20.000
75% 57.000
max 23220.000
我想用它创建一个箱线图,所以我做了a.plot(kind='box')
,这就是我得到的:
该系列的前几篇文章如下所示:
338.000
17.000
9.000
20.000
68.000
288.000
18.000
25.000
为什么箱线图显示不正确?
最大值确实使该图难以阅读。我决定通过这样做来隐藏异常值:
plt.boxplot(a, showfliers=False)
最佳答案
实际上,关于您的值,由于您的最大值:23220.000,您的箱线图显示“正确”。尝试使用 Pandas plot function 的 xlim 和 ylim 参数
关于python - Pandas 系列箱线图未正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44927592/