Skip to content

Commit 0c6b794

Browse files
author
y-p
committed
BUG: restore 10.1 expand_repr behaviour, only for < max_cols, if wider then term GH3706
1 parent 6d08f1e commit 0c6b794

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pandas/core/frame.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -703,10 +703,13 @@ def __unicode__(self):
703703
self.to_string(buf=buf)
704704
else:
705705
width, _ = fmt.get_console_size()
706-
max_rows = get_option("display.max_rows")
707-
if (get_option("display.expand_frame_repr")
708-
and fits_vertical):
709-
# and len(self.columns) < max_rows)
706+
max_columns = get_option("display.max_columns")
707+
expand_repr = get_option("display.expand_frame_repr")
708+
# within max_cols and max_rows, but cols exceed width
709+
# of terminal, then use expand_repr
710+
if (fits_vertical and
711+
expand_repr and
712+
len(self.columns) <= max_columns):
710713
self.to_string(buf=buf, line_width=width)
711714
else:
712715
max_info_rows = get_option('display.max_info_rows')

0 commit comments

Comments
 (0)