简体   繁体   中英

How to set the pandas dataframe output in pycharm console up/down alignment?

before I use

pd.set_option('expand_frame_repr', False)

the pandas output in pycharm console is up/down alignment in rows: alignment in rows

I want to see all of the dataframe columns, so I typed:

pd.set_option('expand_frame_repr', True)

but after this, the output of the dataframe in pycharm console is not up/down alignment in rows, it appears as this: dataframe in pycharm console is not up/down alignment in rows

the output is so terrible because the pandas dataframe is not alignment in rows, So how can I do to make the rows alignment again?

I was facing the same issue and just found out a way to solve it.

It is pretty straight forward, you need to uncheck the Use Soft Wraps button next to the Run Terminal in Pycharm. The button can be found here :

在此处输入图片说明

Below are two screenshots, one with the button checked and one without, we can then see that it corrects the issue!

Screenshot : Use Soft Wraps checked

Screenshot : Use Soft Wraps unchecked

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM