title: Function which is similar to numpy's diff
body: <p>I was wondering if there exists a function, which would compute at the same time moving average and combine it with <code>np.diff</code>?</p>
  
  <p>If you have an array and you would compute a mean for a moving window (moving average) and compute the difference between that mean and next 1 element.</p>
  
  <p>Example: </p>
  
  <pre><code>a = [1, 3, 4, 5, 15, 14, 16, 13]
  b = np.diff(a)
  #np.diff makes something like this: `[n] - [n-1]`
  #I want something like this: `[n] - np.mean([n-m : n])`
  
  #I would like to have a function, where I could vary `m`:
  
  m = 2
  d = [2, 1.5, 10.5, 4, 1.5, -2]
  </code></pre>
  
  <p>How would I implement it, so that time computation wouldn't be so long, since I would like to use it for an array of 26000 elements and higher <code>m</code>?</p>