Using pandas 0.24.2.
Doing the following:
>>> import pandas as pd
>>> pd.DataFrame(range(1000))
Displays the following:
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]
>>>
That is, pd outputs too much data and the table doesn't fit on one screen.
I've looked at other similar questions, like: How do I expand the output display to see more columns? but they talk about pd.utils.terminal, which my pandas version doesn't have:
>>> pd.util.terminal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'pandas.util' has no attribute 'terminal'
The panda docs, as per usual, don't provide any useful information for this.
Two questions:
- Why is this happening?
How can I fix this in an automatic fashion? Ideally without having to set
import pandas as pd pd.set_option('display.max_rows', 500) pd.set_option('display.max_columns', 500) pd.set_option('display.width', 1000)
every single time I run python.