def find_min(x, bin_width = 10): xm = binned_average(x, bin_width=bin_width); imin = np.nanargmin(xm); return int((imin + 0.5) * bin_width);