Pandas DataFrame 表格垂直滚动条

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42724327/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 03:09:09  来源:igfitidea点击:

Pandas DataFrame Table Vertical Scrollbars

pythonpandasjupyter-notebook

提问by magicsword

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.

我有一个大(垂直)pandas 数据框,我想将其显示为带有滚动条的漂亮表格。我可以让它显示包含所有行的表格,但我无法显示滚动条。

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

output: No vertical scrollbars

输出:没有垂直滚动条

enter image description here

在此处输入图片说明

回答by Psidom

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

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

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

enter image description here

在此处输入图片说明



Update:

更新

enter image description here

在此处输入图片说明