python diff between consecutive elements in list code example
Example: python difference between consecutive element in list
a = [0, 1, 2, 3]
[x - a[i - 1] for i, x in enumerate(a)][1:]
a = [0, 1, 2, 3]
[x - a[i - 1] for i, x in enumerate(a)][1:]