Is there a way to widen the display of output in either interactive or script-execution mode?
Specifically, I am using the describe()
function on a pand
It seems like all above answers solve the problem. One more point: instead of pd.set_option('option_name')
, you can use the (auto-complete-able)
pd.options.display.width = None
See Pandas doc: Options and Settings:
Options have a full “dotted-style”, case-insensitive name (e.g.
display.max_rows
). You can get/set options directly as attributes of the top-leveloptions
attribute:In [1]: import pandas as pd In [2]: pd.options.display.max_rows Out[2]: 15 In [3]: pd.options.display.max_rows = 999 In [4]: pd.options.display.max_rows Out[4]: 999
[...]
for the max_...
params:
max_rows
andmax_columns
are used in__repr__()
methods to decide ifto_string()
orinfo()
is used to render an object to a string. In case python/IPython is running in a terminal this can be set to 0 and pandas will correctly auto-detect the width the terminal and swap to a smaller format in case all columns would not fit vertically. The IPython notebook, IPython qtconsole, or IDLE do not run in a terminal and hence it is not possible to do correct auto-detection. ‘None
’ value means unlimited. [emphasis not in original]
for the width
param:
Width of the display in characters. In case python/IPython is running in a terminal this can be set to
None
and pandas will correctly auto-detect the width. Note that the IPython notebook, IPython qtconsole, or IDLE do not run in a terminal and hence it is not possible to correctly detect the width.