Given an array A, with size n, I want a function that returns an array R with size n-2 such that R[i] = A[i+1] - A[i-1].
I tried to check the options of numpy.diff but apparently it only calculates the difference between consecutive elements, i.e., A[i+1] - A[i].