np.vectorize

import numpy as np

def myfunc(a):
    # Return True if a>b, otherwise False"
    if a > 2:
        return bool(True)
    else: return bool(False)

vfunc = np.vectorize(myfunc) # vectorize iterates function.
vfunc([1, 2, 3, 4])
# array([False, False,  True,  True])
Agrius