i've got list of sorted samples. they're sorted sample time, each sample taken 1 second after previous one. i'd find minimum value in neighborhood of specified size. for example, given neighborhood size of 2 , following sample size: samples = [ 5, 12.3, 12.3, 7, 2, 6, 9, 10, 5, 9, 17, 2 ] i'd expect following output: [5, 2, 5, 2] best way achieve in numpy / scipy edited: explained reasoning behind min values: 5 - 2 number window next [12.3 12.3]. 5 smaller 2 - left [12.3, 7] right [6 9]. 2 min 5 - left [9 10] right [9 17]. 5 min notice 9 isn't min there's 2 window left , right smaller value (2) use scipy's argrelextrema : >>> import numpy np >>> scipy.signal import argrelextrema >>> data = np.array([ 5, 12.3, 12.3, 7, 2, 6, 9, 10, 5, 9, 17, 2 ]) >>> radius = 2 # number of elements left , right compare >>> argrelextrema(data, np.less, order=radius) (array([4, 8]),) which suggest nu...