I have two arrays, for example:
array1=numpy.array([1.1, 2.2, 3.3])
array2=numpy.array([1, 2, 3])
How can I find the difference between these two arrays in Python, to give:
[0.1, 0.2, 0.3]
As an array as well?
Sorry if this is an amateur question - but any help would be greatly appreciated!
This is pretty simple with numpy
, just subtract the arrays:
diffs = array1 - array2
I get:
diffs == array([ 0.1, 0.2, 0.3])