I have a numpy
function f
that takes arrays as arguments and a 3D array x[a,b,c]
.
I would like to evaluate the function f
along a specific column. A long-winded way could be with comprehensions:
y = [ [ f(x[a][b]) for a in range(len(x)) ] for b in range(len(x[0]))]
y = np.array(y)
Is there a numpy way of doing this with broadcasting?