Skip to content

Commit a71c815

Browse files
author
y-p
committed
ENH: Adjust height/width/max_rows defaults to match informal survey results
1 parent 0d53d12 commit a71c815

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

pandas/core/config_init.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pandas.core.config as cf
22
from pandas.core.config import (is_int, is_bool, is_text, is_float,
3-
is_instance_factory,is_one_of_factory)
3+
is_instance_factory,is_one_of_factory,get_default_val)
44
from pandas.core.format import detect_console_encoding
55

66
"""
@@ -209,7 +209,7 @@ def mpl_style_cb(key):
209209
cf.register_option('column_space', 12, validator=is_int)
210210
cf.register_option('max_info_rows', 1690785, pc_max_info_rows_doc,
211211
validator=is_instance_factory((int, type(None))))
212-
cf.register_option('max_rows', 100, pc_max_rows_doc, validator=is_int)
212+
cf.register_option('max_rows', 60, pc_max_rows_doc, validator=is_int)
213213
cf.register_option('max_colwidth', 50, max_colwidth_doc, validator=is_int)
214214
cf.register_option('max_columns', 20, pc_max_cols_doc, validator=is_int)
215215
cf.register_option('max_info_columns', 100, pc_max_info_cols_doc,
@@ -229,14 +229,15 @@ def mpl_style_cb(key):
229229
cf.register_option('encoding', detect_console_encoding(), pc_encoding_doc,
230230
validator=is_text)
231231
cf.register_option('expand_frame_repr', True, pc_expand_repr_doc)
232-
cf.register_option('line_width', 80, pc_line_width_doc)
233232
cf.register_option('chop_threshold', None, pc_chop_threshold_doc)
234233
cf.register_option('max_seq_items', None, pc_max_seq_items)
235234
cf.register_option('mpl_style', None, pc_mpl_style_doc,
236235
validator=is_one_of_factory([None, False, 'default']),
237236
cb=mpl_style_cb)
238-
cf.register_option('height', 100, pc_height_doc, validator=is_int)
237+
cf.register_option('height', 60, pc_height_doc, validator=is_int)
239238
cf.register_option('width',80, pc_width_doc, validator=is_int)
239+
# redirected to width, make defval identical
240+
cf.register_option('line_width', get_default_val('display.width'), pc_line_width_doc)
240241
cf.deprecate_option('display.line_width',
241242
msg=pc_line_width_deprecation_warning,
242243
rkey='display.width')

pandas/core/format.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def get_col_type(dtype):
357357
return 'r'
358358
else:
359359
return 'l'
360-
360+
361361
import warnings
362362
if force_unicode is not None: # pragma: no cover
363363
warnings.warn(
@@ -373,7 +373,7 @@ def get_col_type(dtype):
373373
strcols = [[info_line]]
374374
else:
375375
strcols = self._to_str_columns()
376-
376+
377377
if column_format is None:
378378
dtypes = self.frame.dtypes.values
379379
column_format = 'l%s' % ''.join(map(get_col_type, dtypes))
@@ -1683,8 +1683,8 @@ def get_console_size():
16831683
# pure terminal
16841684
terminal_width, terminal_height = get_terminal_size()
16851685
else:
1686-
terminal_width, terminal_height = 80, 100
1687-
1686+
terminal_width, terminal_height = 100, 60
1687+
16881688
return (display_width or terminal_width, display_height or terminal_height)
16891689

16901690

0 commit comments

Comments
 (0)