use numpy to do filtering