[Numpy-discussion] your numpy bug-report -- clamp and percentile

David Cournapeau cournapeau@cslab.kecl.ntt.co...
Tue Mar 25 05:38:37 CDT 2008


On Tue, 2008-03-25 at 10:47 +0100, Sebastian Haase wrote:
> Hi  Connelly !
> 

Hi Sebastian,

> 
> If someone wants to not  "rely" on scipy , then the precentile would
> still be missing .....

The problem is that you can apply this reasoning to any function. So
there should be a limit.

> (And I also have a C implementation for *inplace* clamp (clip)  )

Numpy clip can work inplace if you use the out parameter. I just checked
that it does not create temporaries for huge matrices, and it works (I
created a matrix of more than half my available memory, and clipping it
is works):

a = N.random.randn(10000, 100000)
a.clip(0, 1, out = a)

So maybe there is a doc problem, but the functionality is here.

cheers,

David



More information about the Numpy-discussion mailing list