Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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])
Source by numpy.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
7+1 =