【python】pandas display选项

import pandas as pdspa

 

一、pd.set_option('expand_frame_repr', False)ci

True就是能够换行显示。设置成False的时候不容许换行pandas

二、pd.set_option('display.max_rows', 10)io

pd.set_option('display.max_columns', 10)import

显示的最大行数和列数,若是超额就显示省略号,这个指的是多少个dataFrame的列。若是比较多又不容许换行,就会显得很乱。im

三、pd.set_option('precision', 5)di

显示小数点后的位数co

四、pd.set_option('large_repr', A)header

 truncate表示截断,info表示查看信息,通常选truncatedisplay

五、pd.set_option('max_colwidth', 5)

列长度

六、pd.set_option('chop_threshold', 0.5)

绝对值小于0.5的显示0.0

七、pd.set_option('colheader_justify', 'left')

 显示居中仍是左边,

八、pd.set_option('display.width', 200)

横向最多显示多少个字符, 通常80不适合横向的屏幕,平时多用200.

相关文章
相关标签/搜索