NumPy: Functional programming routines

Functional programming routines

Name Description Syntax
apply_along_axis() Apply a function to 1-D slices along the given axis. numpy.apply_along_axis(func1d, axis, arr, *args, **kwargs)
apply_over_axes() Apply a function repeatedly over multiple axes. numpy.apply_over_axes(func, a, axes)
vectorize() Generalized function class. class numpy.vectorize(pyfunc, otypes=None, doc=None, excluded=None, cache=False, signature=None)
frompyfunc() Takes an arbitrary Python function and returns a NumPy ufunc. numpy.frompyfunc(func, nin, nout)
piecewise() Evaluate a piecewise-defined function. numpy.piecewise(x, condlist, funclist, *args, **kw)