[Numpy-discussion] limit function

Robert Cimrman cimrman3@ntc.zcu...
Thu Jan 15 08:31:01 CST 2009


Neal Becker wrote:
> Is there a function to apply a limit to an array?  I want to (efficiently) do:
> 
> y = x if x < limit, otherwise limit

What about np.clip?

r.



More information about the Numpy-discussion mailing list