I have two numpy arrays of the same shape. I want to subtract once from the other. I have tried two methods but numpy is not returning correct values.
dif = np.subtract(b4, b5)
and
dif = b4 - b5
However, for both,
b4.shape == b5.shape
Out[66]: True
b4[0,1]
Out[67]: 72
b5[0,1]
Out[68]: 111
dif = b4 - b5
dif[0,1]
Out[70]: 217
dif = np.subtract(b4, b5)
dif[0,1]
Out[72]: 217
The real answer is 72 – 111 = -39. Why is numpy returning 217?