Getting wider output in PyCharm's built-in console

前端 未结 4 2071
情歌与酒
情歌与酒 2021-01-30 06:54

I\'m relatively new to using the PyCharm IDE, and have been unable to find a way to better shape the output when in a built-in console session. I\'m typically working with prett

4条回答
  •  逝去的感伤
    2021-01-30 07:15

    It appears I was mistaken in thinking that the issue was one in PyCharm (that could be solved, for example, in a setting or preference.) It actually has to do with the console session itself. The console attempts to auto-detect the width of the display area, but when that fails it defaults to 80 characters. This behavior can be overridden with:

    import pandas as pd
    desired_width = 320    
    pd.set_option('display.width', desired_width)
    

    Where you can of course set the desired_width to whatever your display will tolerate. Thanks to @TidB for the suggestion that my initial concern wasn't focused in the right area.

提交回复
热议问题