title: numpy how find local minimum in neighborhood on 1darray
body: <p>I've got a list of sorted samples. They're sorted by their sample time, where each sample is taken one second after the previous one. 
  I'd like to find the minimum value in a neighborhood of a specified size.</p>
  
  <p>For example, given a neighborhood size of 2 and the following sample size:</p>
  
  <pre><code>samples = [ 5, 12.3, 12.3, 7, 2, 6, 9, 10, 5, 9, 17, 2 ]
  </code></pre>
  
  <p>I'd expect the following output: [5, 2, 5, 2]
  What would be the best way to achieve this in numpy / scipy</p>
  
  <p>Edited: Explained the reasoning behind the min values:</p>
  
  <ol>
  <li>5 - the 2 number window next to it are [12.3 12.3]. 5 is smaller</li>
  <li>2 - to the left [12.3, 7] to the right [6 9]. 2 is the min</li>
  <li>5 - to the left [9 10] to the right [9 17]. 5 is the min</li>
  </ol>
  
  <p>notice that 9 isn't min are there's a 2 window to its left and right with a smaller value (2)</p>