in[2:end] - in[1:end-1]
On Saturday, February 7, 2015 at 7:19:39 AM UTC-5, Evan Pu wrote: > > say I want to compute a pair-wise diff for all the elements in the array. > input: [1, 2, 4, 7, 8] > output: [1, 2, 3, 1] > > is there some kind of "beautiful" way of doing it? i.e. w/o using a for > loop nor using explicit indecies >
