ufunc.reduce()

numpy.ufunc.reduce

ufunc.reduce(a, axis=0, dtype=None, out=None, keepdims=False)

Reduces a‘s dimension by one, by applying ufunc along one axis.

Let a.shape = (N_0, ..., N_i, ..., N_{M-1}). Then ufunc.reduce(a, axis=i)[k_0, ..,k_{i-1}, k_{i+1}, .., k_{M-1}] = the result of iterating j over range(N_i), cumula