import numpy as np

def isinteger(x):
    return np.equal(np.mod(x, 1), 0)
foo = np.array([0.0, 1.5, 1.0])
bar = np.array([-5, 1, 2, 3, -4, -2, 0, 1, 0, 0, -1, 1])
isinteger(foo)
isinteger(bar)
isinteger(1.5)
isinteger(1.0)
isinteger(1)
How do I find out if a numpy array contains integers?