I have two 3D numpy arrays and I would like to find out the difference between them.
>>>A.dtype
dtype('uint32')
>>>B.dtype
dtype('uint32')
>>>A.shape
(86, 50, 108)
>>>B.shape
(86, 50, 108)
>>>A.min()
0
>>>B.min()
0
>>>A.max()
89478487
>>>B.max()
89115767
Now, if we do A - B
>>> diff = abs( A-B );
>>> diff.min()
0
>>> diff.max()
4294967292
Considering the min
and max
values of both matrices we cannot have 4294967292
as maximum value of the difference matrix.
I have also done similar operations in Matlab and the difference diff
and maximum value diff.max()
are consistent. What is exactly A-B
operation doing? My understanding is that the default behaviour for add, subtract, multiply and divide arrays with each other was element-wise operations however there is something funny happening here.