I am using a Jupyter notebook. I have a pretty wide screen, but the displayed output (say, when I print a numpy
array) is formatted as if the screen was narrow.
I found a way of increasing the width of the cells, with
from IPython.core.display import HTML
HTML("<style>.container { width:95% !important; }</style>")
but this seems to influence the input only, not the output (see screenshots):
I've tried setting the linewidth
option in numpy.set_printoptions
, I've tried setting numpy.core.arrayprint._line_width
, nothing...
EDIT: Using matplotlib I can set the width of plots (that I plot in the notebook with the magic %matplotlib inline
) with the command plt.rcParams['figure.figsize']=[X,Y]
. It turns out that I can increase X
to have plots fill the output cell horizontally all the way. This means (I think) that the original problem it's a numpy
thing.
pd.set_option('display.max_columns', 50) pd.set_option('display.width', 120)
np.set_printoptions(suppress=True, linewidth=100000)