小编use*_*674的帖子

在numpy四舍五入?

我有python pandas和numpy的奇怪问题.

>>> np.float64(1) * np.float64(85000) * np.float64(7.543709)
641215.26500000001

>>> round( np.float64(1) * np.float64(85000) * np.float64(7.543709), 2 )
641215.26000000001

>>> np.round( np.float64(1) * np.float64(85000) * np.float64(7.543709), 2 )
641215.26000000001
Run Code Online (Sandbox Code Playgroud)

如何舍入才能得到正确的结果641215.27?

python numpy rounding pandas

4
推荐指数
1
解决办法
4686
查看次数

标签 统计

numpy ×1

pandas ×1

python ×1

rounding ×1