如何为 df 的每一行制作箱线图?
我有一些数据,看起来像:
df = pd.DataFrame({'in1' : [100, 150, 110, 180, 125],
'in2' : [200, 210, 125, 125, 293],
'in3' : [50, 35, 200, 100, 180]
'a' : [c, d, e, f,g]})
如何制作每行 in1 到 in3 的箱线图?
I have some data, it looks like:
df = pd.DataFrame({'in1' : [100, 150, 110, 180, 125],
'in2' : [200, 210, 125, 125, 293],
'in3' : [50, 35, 200, 100, 180]
'a' : [c, d, e, f,g]})
How can I make a boxplot per row of in1 to in3?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需输入以下内容:
pandas.DataFrame.boxplot
方法为每一列创建一个框。您可以通过使用pandas.DataFrame.T
方法来解决此问题,该方法会转置数据帧(即,行变为列,反之亦然)。Simply type this:
The
pandas.DataFrame.boxplot
-method creates a box for each column. You can work around this by using thepandas.DataFrame.T
-method which transposes the dataframe (i.e., rows become columns and vice versa).