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