04pallav
9/11/2017 - 10:26 PM

np.diff

np.diff

x = np.array([1, 2, 4, 7, 0])
np.diff(x)
# array([ 1,  2,  3, -7])