What you are hoping for here is known as "short circuit" or "lazy"
evaluation. Namely, this would work if np.where(cond, x, y) only evaluates
x if cond is true and only evaluates y if cond is false. In this case, not
only can it handle situations where one of the true/false cases "breaks"
one of th
Oct 26, 2023 at 5:54 AM Dom Grigonis wrote:
> Could you please give a concise example? I know you have provided one, but
> it is engrained deep in verbose text and has some typos in it, which makes
> hard to understand exactly what inputs should result in what output.
>
> Regards,
I know this question has been asked before, both on this list as well as
several threads on Stack Overflow, etc. It's a common issue. I'm NOT asking
for how to do this using existing Numpy functions (as that information can
be found in any of those sources)--what I'm asking is whether Numpy would
a