title: Numpy difference between neighboring elements
body: <p>I have algorithm of calculation of the difference between neighboring elements in pure python:</p>
  
  <pre><code>    a = range(1000000) #it's numpy array in my case
      prev = a[0]
      b = [0, ]
      for i in a[1:]:
          b.append(i - prev)
          prev = i
  </code></pre>
  
  <p>Is there any way to rewrite this functions with Numpy?</p>