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