I want to make divisioin between two ndarrays and if there is a zero at one index of divisor, at the same index of result, there should be a zero. Is there any way to do it elegantly rather than using for
loop to check every elements?
normal = np.empty(grad.shape, dtype=arrOrg.dtype)
for i in range(3):
normal[i] = grad[i]/mod
If I just do so, there would be a warning:
RuntimeWarning: invalid value encountered in true_divide