title: Derivative of an array in python?
body: <p>Currently I have two numpy arrays: <code>x</code> and <code>y</code> of the same size.</p>
  
  <p>I would like to write a function (possibly calling numpy/scipy... functions if they exist):</p>
  
  <pre><code>def derivative(x, y, n = 1):
      # something
      return result
  </code></pre>
  
  <p>where <code>result</code> is a numpy array of the same size of <code>x</code> and containing the value of the <code>n</code>-th derivative of <code>y</code> regarding to <code>x</code> (I would like the derivative to be evaluated using several values of <code>y</code> in order to avoid non-smooth results).</p>