Efficient thresholding filter of an array with numpy Efficient thresholding filter of an array with numpy numpy numpy