【发布时间】:2014-08-11 12:42:28
【问题描述】:
我的 Pandas 数据框的头部 df 如下所示:
count1 count2 totalcount season
0 3 13 16 1
1 8 32 40 1
2 5 27 32 1
3 3 10 13 1
4 0 1 1 1
我想制作 count1、count2 和 totalcount 的箱线图,按 season 分组(有 4 个季节),并让每组箱线图显示在各自的子图中单人图。
当我只使用其中两列(例如 count1 和 count2)时,一切看起来都很棒。
df.boxplot(['count1', 'count2'], by='season')
但是当我将totalcount 添加到组合中时,轴限制变得混乱。
df.boxplot(['count1', 'count2', 'totalcount'], by='season')
无论列的顺序如何,都会发生这种情况。我知道有几种方法可以解决这个问题,但如果能正常工作会更方便。
我错过了什么吗?这是 Pandas 中的一个已知错误吗?我在第一遍 Pandas 错误报告中找不到任何内容。
我正在使用 Pandas 0.14.0 和 matplotlib 1.3.1。
【问题讨论】:
标签: python matplotlib pandas