您可以使用numpy.extract https://docs.scipy.org/doc/numpy/reference/generated/numpy.extract.html:
>>> nparr = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
>>> nparreven = np.extract(nparr % 2 == 0, nparr)
or numpy.where https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html:
>>> nparr = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
>>> nparreven = nparr[np.where(nparr % 2 == 0)]