Numpy Filter Array Based On Condition In Sql