I have a numpy array arr
. It's a numpy.ndarray
, size is (5553110,)
, dtype=float32
.
When I do:
(arr > np.pi )[3154950]
False
(arr[3154950] > np.pi )
True
Why is the first comparison getting it wrong? And how can I fix it?
The values:
arr[3154950]= 3.1415927
np.pi= 3.141592653589793
Is the problem with precision?