[Numpy-discussion] Any interest in a 'heaviside' ufunc?

Pierre Haessig pierre.haessig at crans.org
Fri Feb 6 05:01:14 EST 2015


Le 04/02/2015 06:58, Jaime Fernández del Río a écrit :
>
>     I have an implementation of the Heaviside function as numpy
>     ufunc.  Is there any interest in adding this to numpy?  The
>     function is simply:
>
>                         0    if x < 0
>         heaviside(x) =  0.5  if x == 0
>                         1    if x > 0
>
>
> I don't think there's anything like it in numpy. Wouldn't
> scipy.special be a better home for it?
scipy.signal could also host it, since it already contains functions for
linear systems (e.g. step response, which are closely related), and also
some waveform generators like square()

http://docs.scipy.org/doc/scipy-0.14.0/reference/signal.html

However, I agree with Joseph when he says that this function is a bit thin.

best,
Pierre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150206/3d21bf10/attachment.html>


More information about the NumPy-Discussion mailing list