本文介绍了 pandas DataFrame表垂直滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大的(垂直)熊猫数据框,我想将其显示为带有滚动条的漂亮表格.我可以显示所有行的表格,但是无法显示滚动条.

I have a large (vertically) pandas dataframe that I would like to display as a nice table with scrollbars. I can get it to display the table with all the rows but I cannot get the scrollbars to display.

def data(x):
    strData = strData[['Data1','Data2','Data3']]
    display(strData)

输出:没有垂直滚动条

推荐答案

不确定这是否是您的意思,但是我想您需要将max_rows选项设置为无",以便熊猫不会设置限制在显示的行数上:

Not sure if this is what you mean, but I guess you need to set the max_rows option to None, so that pandas doesn't put a limit on the number of rows displayed:

pd.set_option("display.max_rows", None)

更新:

这篇关于 pandas DataFrame表垂直滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 09:10