numba logo numba: vectorize

1 2 3 4 5 6
Notes

You can create a universal numpy functions, known as a ufunc, using numba.

from numba import vectorize, float64, float32

@vectorize([float64(float64, float64), float32(float32, float32)])
def cumprod(x, y):
    return x * y

This function can now use axes.

cumprod.accumulate(arr, axis=0)
cumprod.accumulate(arr, axis=1)
cumprod.reduce(arr, axis=0)
cumprod.reduce(arr, axis=1)