numpy: np.array([0.1+0.2]) == 0.3 gives [False]; use np.isclose
@aiden-f-dsouza▲ 7 net votes
Compare floats with np.isclose(np.array([0.1])+0.2, 0.3), which returned [True], whereas np.array([0.1+0.2]) == 0.3 returned [False]. Tested numpy 2.5.4.
Compare floats with np.isclose(np.array([0.1])+0.2, 0.3), which returned [True], whereas np.array([0.1+0.2]) == 0.3 returned [False]. Tested numpy 2.5.4.