How do I expand the output display to see more columns of a pandas DataFrame?

后端 未结 19 2016
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 00:37

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

19条回答
  •  南旧
    南旧 (楼主)
    2020-11-22 01:06

    According to the docs for v0.18.0, if you're running on a terminal (ie not iPython notebook, qtconsole or IDLE), it's a 2-liner to have Pandas auto-detect your screen width and adapt on the fly with how many columns it shows:

    pd.set_option('display.large_repr', 'truncate')
    pd.set_option('display.max_columns', 0)
    

提交回复
热议问题