Implement heaviside(a, b) element-wise for equal-length 1-D arrays a and b:
a[k] < 0: out[k] = 0a[k] == 0: out[k] = b[k]a[k] > 0: out[k] = 1Do not call np.heaviside. Use comparisons and arithmetic (a where-style blend).
Example:
heaviside(np.array([-2., 0., 3.]), np.array([0.5, 0.5, 0.5])) -> [0.0, 0.5, 1.0]