a
and b
are 1 dimensional numpy arrays (or python lists):
I am doing this:
>>> c = [x/y for x,y in zip(a,b)]
Occasionally b
has a zero in it - so a division by zero error occurs.
How can I conditionally check for a 0 value in b
and set the corresponding element of c
to 0?