python - Pandas 系列箱线图未正确显示

标签 python pandas plot boxplot

我有一个名为 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'),这就是我得到的: enter image description here 该系列的前几篇文章如下所示:

338.000
17.000
9.000
20.000
68.000
288.000
18.000
25.000

为什么箱线图显示不正确?


最大值确实使该图难以阅读。我决定通过这样做来隐藏异常值:

plt.boxplot(a, showfliers=False)

enter image description here

最佳答案

实际上,关于您的值,由于您的最大值:23220.000,您的箱线图显示“正确”。尝试使用 Pandas plot function 的 xlim 和 ylim 参数

关于python - Pandas 系列箱线图未正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44927592/

相关文章:

python - Pandas 中日期系列(不是索引)的算术运算

python - 引用自身的 Pandas 列

python - 在 Python 中,如何检查字符串是否包含字母或数字?

python - 递归错误: maximum recursion depth exceeded on integrate, sympy 1.1.1

Python pandas,如何只绘制一个实际有数据点的 DataFrame 并留下间隙

r - 如何绘制线性回归到双对数 R 图?

r - R 或 ggplot2 中的默认绘图颜色是什么?

python - 更新 json 文件

python - 如何将 Pandas 时区感知时间戳转换为 UNIX 纪元?

pandas - 读取 CSV 会创建太多行/列