[SciPy-user] I can't find unit step function.

David Warde-Farley david.warde.farley@utoronto...
Tue Mar 20 15:57:14 CDT 2007


On 20-Mar-07, at 4:54 PM, Anne Archibald wrote:

> On 20/03/07, Ryan Krauss <ryanlists@gmail.com> wrote:
>> Sorry to contribute to this discussion out of boredom and curiosity,
>> but what about:
>>
>> y=where(t>0,1.0,0)
>
> Or
> y=(1+sign(t))/2.
> for conciseness and the 0.5 both...
>
> Anne

Bravo! I think we can consider this dead horse adequately flogged ;)

David


More information about the SciPy-user mailing list