-
1、解决输出格式
...
和科学计数法输出的问题-
numpy
中解决数据显示不完全和科学计数法显示数据的问题,解决数据多了用...
代替的问题import numpy as np # suppress=True 取消科学记数法 # threshold=np.nan或者np.inf 完整输出(没有省略号) np.set_printoptions(suppress=True, threshold=np.nan) # 也可以用np.inf,但是tensorflow中只能用np.inf # 不采用科学计数法的另一种方式 np.set_printoptions(precision=3, suppress=True) np.set_printoptions(formatter={'float': '{: 0.3f}'.format})
-
pandas
中解决数据显示不完全和科学计数法显示数据的问题,解决数据多了用...
代替的问题#显示所有列 pd.set_option('display.max_columns', None) #显示所有行 pd.set_option('display.max_rows', None) #设置value的显示长度为100,默认为50 pd.set_option('max_colwidth',100) # 设置输出数据的格式 pd.set_option('precision', 5) #设置精度 # 为了直观的显示数字,不采用科学计数法 pd.set_option('display.float_format', lambda x: '%.5f' % x)
-
tensorflow
中数据显示不完全的问题import numpy as np np.set_printoptions(suppress=True, threshold=np.inf)
-
numpy、pandas、tensorflow解决输出格式...和科学计数法输出的问题
最新推荐文章于 2023-03-22 17:27:46 发布