You can do it with np.piecewise
as follows (apologies for formatting!):
ys = np.piecewise(
xs,
[(xs >= segments[i]) & (xs <= segments[i+1]) for i in range(len(segments)-1)],
funcs)
The results are the same.
Essentially your loop and the test equivalent to your line indaseg = np.logical_and(xs>=segments[ii], xs<=segments[ii+1])
is moved into the calling code.