【问题标题】:Pandas Series boxplot not showing correctly熊猫系列箱线图未正确显示
【发布时间】:2017-12-09 04:52:07
【问题描述】:

我有一个名为 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)

【问题讨论】:

    标签: python pandas plot boxplot


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-05
      • 1970-01-01
      • 2021-04-02
      • 2023-02-07
      • 1970-01-01
      • 1970-01-01
      • 2014-12-17
      • 2020-11-29
      相关资源
      最近更新 更多