title: Numpy version of rolling MAD (mean absolute deviation)
body: <p>How to make a rolling version of the following MAD function</p>
  
  <pre><code>from numpy import mean, absolute
  
  def mad(data, axis=None):
      return mean(absolute(data - mean(data, axis)), axis)
  </code></pre>
  
  <p>This code is an answer to <a href="https://stackoverflow.com/a/19472336/2480410">this question</a> </p>
  
  <p>At the moment i convert numpy to pandas then apply this function, then convert the result back to numpy </p>
  
  <pre><code>pandasDataFrame.rolling(window=90).apply(mad) 
  </code></pre>
  
  <p>but this is inefficient on larger data-frames. How to get a rolling window for the same function in numpy without looping and give the same result?</p>