[Numpy-discussion] limit function

David Cournapeau cournape at gmail.com
Thu Jan 15 09:32:32 EST 2009


On Thu, Jan 15, 2009 at 11:27 PM, Neal Becker <ndbecker2 at gmail.com> wrote:
> Is there a function to apply a limit to an array?  I want to (efficiently) do:
>
> y = x if x < limit, otherwise limit

Would clip do ? For native types, it should be relatively fast, in
particular if you use the argout argument,

David



More information about the NumPy-Discussion mailing list