I'm not sure if it is a bug or not. In below code, I got [0.0, 0.0, 0.1]
and [0.0, 0.1, 0.1]
as output, which are different. But I expected that both of the 2 print()
output [0.0, 0.1, 0.1]
import numpy as np
print([round(x,1) for x in np.array([0.049, 0.05, 0.0501])])
print([round(x,1) for x in [0.049, 0.05, 0.0501]])