使用np.savetxt可以dump数据
np.set_printoptions(suppress=True)
np.set_printoptions(precision=4) #设精度
np.savetxt('data_name', data.reshape(-1, 1), fmt='%.04f') #保留4位小数
numpy在print时会有...省略掉中间部分,如果希望显示处完整数组:
np.set_printoptions(threshold=np.inf)
#
使用np.savetxt可以dump数据
np.set_printoptions(suppress=True)
np.set_printoptions(precision=4) #设精度
np.savetxt('data_name', data.reshape(-1, 1), fmt='%.04f') #保留4位小数
numpy在print时会有...省略掉中间部分,如果希望显示处完整数组:
np.set_printoptions(threshold=np.inf)
#