One - One Code All

Blog Content

python将pandas或numpy省略的数据全部显示display

Python 统计学-科学计算   2011-09-05 21:56:22

打印前设置:

numpy:
np.set_printoptions(threshold='nan') #全部输出

pandas列间省略:
pd.set_option('display.width',None)

pandas行与行之间的省略:
pd.set_option('display.max_rows', None)


#显示所有列

pd.set_option('display.max_columns', None)

#显示所有行

pd.set_option('display.max_rows', None)


让Row省略号都显示,DataFrame默认的显示长度为50,修改默认设置

pd.set_option('max_colwidth',2000) # 列间
pd.set_option('display.max_rows', 2000) # 行间



上一篇:pandas中Dataframe中小数的保留小数点后两位
下一篇:python中pandas的dataframe给Nan值更改为0

The minute you think of giving up, think of the reason why you held on so long.