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

2015-02-06 Thread Pierre Haessig
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: > > 0if x < 0 > heaviside(x) = 0.5 if x == 0 >

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

2015-02-05 Thread Alexander Eberspächer
On 04.02.2015 11:45, Daπid wrote: > There are several definitions. Abramowitz and Stegun > (http://people.math.sfu.ca/~cbm/aands/page_1020.htm) assign the value > 0.5 at x=0. The NIST handbook uses the value 0 at x=0. Perhaps a Heaviside with an optional argument that defines the value at x=0 wo

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

2015-02-04 Thread Daπid
On 4 February 2015 at 11:05, Sturla Molden wrote: > On 04/02/15 06:18, Warren Weckesser wrote: > >> By "discrete form", do you mean discrete time (i.e. a function defined >> on the integers)? Then I agree, the discrete time unit step function is >> defined as > > It is the cumulative integral of

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

2015-02-04 Thread Sturla Molden
On 04/02/15 06:18, Warren Weckesser wrote: > By "discrete form", do you mean discrete time (i.e. a function defined > on the integers)? Then I agree, the discrete time unit step function is > defined as It is the cumulative integral of the delta function, and thus it can never obtain the value

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

2015-02-03 Thread josef.pktd
On Wed, Feb 4, 2015 at 12:18 AM, Warren Weckesser < warren.weckes...@gmail.com> wrote: > > > On Tue, Feb 3, 2015 at 11:14 PM, Sturla Molden > wrote: > >> Warren Weckesser wrote: >> >> > 0if x < 0 >> > heaviside(x) = 0.5 if x == 0 >> > 1if x >

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

2015-02-03 Thread Jaime Fernández del Río
On Tue, Feb 3, 2015 at 12:58 PM, Warren Weckesser < warren.weckes...@gmail.com> wrote: > I have an implementation of the Heaviside function as numpy ufunc. Is > there any interest in adding this to numpy? The function is simply: > > 0if x < 0 > heaviside(x) = 0.5 if

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

2015-02-03 Thread Warren Weckesser
On Tue, Feb 3, 2015 at 11:14 PM, Sturla Molden wrote: > Warren Weckesser wrote: > > > 0if x < 0 > > heaviside(x) = 0.5 if x == 0 > > 1if x > 0 > > > > This is not correct. The discrete form of the Heaviside step function has > the value 1 for

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

2015-02-03 Thread Aron Ahmadia
> This is not correct. The discrete form of the Heaviside step function has > the value 1 for x == 0. > Yeah, I was looking at it and wondering if I'd misremembered the definition. Assuming you're implementing the discrete Heaviside function, H[0] = 1 as Sturla notes. ___

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

2015-02-03 Thread Sturla Molden
Warren Weckesser wrote: > 0if x < 0 > heaviside(x) = 0.5 if x == 0 > 1if 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 ___

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

2015-02-03 Thread Aron Ahmadia
That seems useful to me. On Tue, Feb 3, 2015 at 3:58 PM, Warren Weckesser wrote: > I have an implementation of the Heaviside function as numpy ufunc. Is > there any interest in adding this to numpy? The function is simply: > > 0if x < 0 > heaviside(x) = 0.5 if x =

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

2015-02-03 Thread Warren Weckesser
I have an implementation of the Heaviside function as numpy ufunc. Is there any interest in adding this to numpy? The function is simply: 0if x < 0 heaviside(x) = 0.5 if x == 0 1if x > 0 Warren __