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

David Warde-Farley david.warde.farley at utoronto.ca
Tue Mar 20 16:57:14 EDT 2007


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

> On 20/03/07, Ryan Krauss <ryanlists at 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