python大 pandas 无法显示大数据帧的摘要 [英] python pandas unable to display summary of large dataframe

查看:106
本文介绍了python大 pandas 无法显示大数据帧的摘要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近升级到大熊猫版本0.13,并且遇到这个问题,无论我的数据帧多大(最大的是25列和158430行),大熊猫打印出整个数据框(完全不是全部,只是一个每列中几行,但仍然凌乱!),而不是打印汇总表,在这种大数据帧的情况下,这个汇总表更为清晰。我只是想知道其他人是否有这个问题,或者过去遇到过这个问题,知道如何解决这个问题。



提前感谢

解决方案

对于.13,href =http://pandas-docs.github.io/pandas-docs-travis/whatsnew.html#dataframe-repr-changes =noreferrer>新功能。 p>

旧的方法是打印 df.info()的结果。您可以通过 set_option('display.large_repr','info')更改行为。如果您使用IPython,可以将其添加到IPython启动文件中。


I recently upgraded to pandas version 0.13 and am experiencing this problem where no matter how big my dataframe is ( the biggest one has 25 columns and 158430 rows), pandas prints out the entire dataframe (well not the entire thing, just a few rows in each column but it's still messy!) instead of printing out the summary table which is much cleaner in the case of such large data frames. I was just wondering whether anyone else is having this problem or has had this problem in the past and knows how to fix it.

Thanks in advance!

解决方案

Here's the change in the what's new for .13.

The old way was to print the result of df.info(). You can change the behavior to always do that with set_option('display.large_repr', 'info'). You can add that to your IPython startup file if you're using IPython.

这篇关于python大 pandas 无法显示大数据帧的摘要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆