Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spyder - IPython console - enable printing across the screen width

I am using the IPython console through Spyder. Is it possible to allow the console to print across the entire screen? The included picture shows the amount of empty space in the console. It's especially frustrating when I print a dataframe with many columns and I'm limited to seeing 6 at a time.

Spyder console pic

like image 625
jstauss Avatar asked Dec 19 '25 07:12

jstauss


1 Answers

for pandas.DataFrame objects you can set the display width as explained in docs

https://pandas.pydata.org/pandas-docs/stable/generated/pandas.set_option.html

to whatever limit you wish. They say IPython does not run in a terminal (when used within Spyder), so it cannot auto-detect the width, hence you should provide a specific value as in, ex:

pandas.set_option('display.width', 140)

and it will display up to 140 cols, then truncate.

like image 140
vuvu Avatar answered Dec 21 '25 21:12

vuvu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!