def func2(x, y, z):
    return np.sin(y * x) + z
xaxis = np.linspace(0, 4, 10)
yaxis = np.linspace(-1, 1, 20)
zaxis = np.linspace(0, 1, 20)
result2 = func2(xaxis[:, (None), (None)], yaxis[(None), :, (None)], zaxis[(
    None), (None), :])
numpy - evaluate function on a grid of points