python numpy和pandas作數據分析時去掉科學記數法顯示

1.Numpy

1 import numpy as np
2 np.set_printoptions(suppress=True, threshold=np.nan)

suppress=True 取消科學記數法spa

threshold=np.nan 完整輸出(沒有省略號)code

 

2.Pandasorm

1 pd.set_option('display.float_format', lambda x: '%.3f' % x)

用pd.set_option設置display.float_format參數來設置顯示的小數位數blog

相關文章
相關標籤/搜索