Warren Weckesser <warren.weckes...@gmail.com> wrote:

>                     0    if x < 0
>     heaviside(x) =  0.5  if x == 0
>                     1    if x > 0
> 

This is not correct. The discrete form of the Heaviside step function has
the value 1 for x == 0.

heaviside = lambda x : 1 - (x < 0).astype(int)



Sturla

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to