I have two arrays of type float64, and when I assign the value of the first to the second, it rounds the value. The following simple code illustrates the problem and eliminates the possibility of simply representing numbers. (I schematized a snippet of my code to be more readable, but essentially the same thing)
X = zeros((2,2))
Y = zeros((2,2))
Z = X
X[0,0] = Y[0,0]
Z[0,0]=0
print Y[0,0]
print X[0,0]
print type(Y[0,0])
print type(X[0,0])
if X[0,0]==Y[0,0]:
print'they are equal'
else:
print'they are NOT equal'
I executed this small code snippet for all coefficients, and all outputs look like this:
1.90897e-14
0
<type 'numpy.float64'>
<type 'numpy.float64'>
they are NOT equal
It seems to me that the X array is of a different type, but it is created in the same way, with the zeros () function with the standard type (float64)
Edit: arrays are initialized with
X = zeros((2,2), dtype=float64)
Y = zeros((2,2), dtype=float64)
An additional useful fingerprint has also been added to the above example.
Edit: added problem lines after I found the problem