compare two 1d arrays in numpy code example Example: numpy difference between two arrays import numpy as np result = np.subtract([1.1, 2.2, 3.3], [1, 2, 3])