使用pandas 0.24.2。
执行以下操作:
>>> import pandas as pd
>>> pd.DataFrame(range(1000))
显示以下内容:
10 10
11 11
12 12
13 13
14 14
15 15
16 16
17 17
18 18
19 19
20 20
21 21
22 22
23 23
24 24
25 25
26 26
27 27
28 28
29 29
.. ...
970 970
971 971
972 972
973 973
974 974
975 975
976 976
977 977
978 978
979 979
980 980
981 981
982 982
983 983
984 984
985 985
986 986
987 987
988 988
989 989
990 990
991 991
992 992
993 993
994 994
995 995
996 996
997 997
998 998
999 999
[1000 rows x 1 columns]
>>>
也就是说,pd输出的数据太多而且表格不适合一个屏幕。
我看过其他类似的问题,比如:How do I expand the output display to see more columns?,但是他们谈的是pd.utils.terminal,这是我的熊猫版没有的:
>>> pd.util.terminal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'pandas.util' has no attribute 'terminal'
按照惯例,熊猫文档没有为此提供任何有用的信息。
两个问题:
每次我运行python。
看起来像pandas.util.terminal.get_terminal_size()
可能已弃用,因为它不再可用(文档中也没有提到)。
虽然pandas.util
使用来自same function的shutil
,如果它可以帮助。
您正在寻找python startup file或ipython startup file,它将使用自定义设置启动每个ipython会话。关于pandas
配置的更多细节确实表明了in the doc。
希望这会有所帮助。