Python 格式化打印

       for candidate in candidates:
            dist = np.sqrt(np.sum(np.square(np.subtract(srcnp, fdnp))))
            print('  %1.4f  ' % dist, end='')



#Output
0.7743    0.8001    0.7743    0.8001
#0.7742783147751011

score = round(score, 4)
print(score)

#0.7743
发布了1715 篇原创文章 · 获赞 380 · 访问量 247万+

猜你喜欢

转载自blog.csdn.net/tony2278/article/details/104854795
今日推荐