question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't pd.options.display.max_columns = 0 by default?

See original GitHub issue

pd.options.display.max_columns is 20 by default, but when running in a terminal this value could be auto-detected by setting it to 0. I know that this setting can be customized, but for the average user it would be much more convenient if there was no extra step involved. Is there a way to detect if pandas is running in a terminal (where autodetection works)? If so, the value should be set to 0. Otherwise, for example in Jupyter notebooks, it could remain to be 20.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
TomAugspurgercommented, Jul 13, 2017

I usually set the max columns to 0 in my IPython init. I think it would be ok to change the default.

Do we still run into issues where we can’t reliably detect the terminal width, or have those all been fixed?

0reactions
cbrnrcommented, Jul 19, 2017

Regarding the detection of the terminal width, I think it doesn’t work in PyCharm’s integrated terminal. However, the default of 80 is a reasonable value in this case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Options and settings — pandas 1.5.2 documentation
display.max_colwidth sets the maximum width of columns. Cells of this length or longer will be truncated with an ellipsis. >>>
Read more >
How do I expand the output display to see more columns of a ...
You can change the options for the Pandas max_columns feature as follows: import pandas as pd pd.options.display.max_columns = 10 · Like that, you...
Read more >
6 Pandas Display Options You Should Memorise
By default, Pandas only display content in a cell with a maximum width of 50. That is, a cell with more than 50...
Read more >
Python Pandas - Options and Customization - Tutorialspoint
display.max_columns. Displays the default number of value. Interpreter reads this value and displays the rows with this value as upper limit to display....
Read more >
pandas: Get and set options for display, data behavior, etc.
pandas: Get and set options for display, data behavior, etc. · Get and set option values with attribute: options · Print the description...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found