大熊猫数据框的框图

时间:2016-11-07 02:38:18

标签: python pandas machine-learning scikit-learn

{'boxes': [<matplotlib.lines.Line2D at 0x118efc278>,
<matplotlib.lines.Line2D at 0x118f0c668>,
<matplotlib.lines.Line2D at 0x118f20f98>,
<matplotlib.lines.Line2D at 0x11d58e908>,
<matplotlib.lines.Line2D at 0x11d5a6278>,
<matplotlib.lines.Line2D at 0x11d5b7ba8>,}

它按预期返回数据框中所有列的图。但它也在返回文本。例如:

my_dict = {'A' : 'can' , 'B' : 'Flower' , 'C' : 'house'}
another_dict = my_dict.copy()

有没有办法删除文本,而且任何自定义图表以突出显示异常值的建议都会非常有用。提前致谢

1 个答案:

答案 0 :(得分:1)

正如@Greg上面所说,这是一个功能响应。

我猜你正在使用Jupyter / IPython笔记本绘制内联,所以你永远不必实际调用plt.show()

虽然你肯定可以使用a = df.boxplot()甚至只是df.boxplot();,但我建议你实际养成使用plt.show()的习惯,这样如果以后你想要执行你的代码除了内联jupyter会话之外的其他地方,你可以。

import matplotlib.pyplot as plt

[...]

In [x]: df.boxplot()
        plt.show()