Consider the following numpy vector of number:
a = np.array([.1, .2, .2, .2, .2, .1])
Obviously, the sum of these numbers gives 1. However, when computing
b = np.sum(a)
I get
print (b)
0.9999999999999999
Could you anyone explain why and how to solve this approximation issue?