![](https://secure.gravatar.com/avatar/375db2b141a23559e312dfd2b983d1c5.jpg?s=120&d=mm&r=g)
Dec. 29, 2006
4:26 p.m.
Quoting Stef Mientki <s.mientki@ru.nl>:
Does anyone know the equivalent of the MatLab "diff" function. The "diff" functions calculates the difference between 2 succeeding elements of an array.
Then it is the numpy.diff function you'r looking for. In [19]:import numpy In [20]:numpy.diff([1,2,4,1]) Out[20]:array([ 1, 2, -3]) Otto