def foo(zeta):
    result = np.empty_like(zeta)
I = condition(zeta)
nI = ~I
result[I] = func1(zeta[I])
result[nI] = func2(zeta[nI])
Efficient way to do math in elements of a numpy array according to condition