Re: [Numpy-discussion] Getting 95%/99% margin of ndarray

2009-07-23 Thread Scott Sinclair
> 2009/7/23 Pierre GM : > > On Jul 23, 2009, at 6:07 AM, Scott Sinclair wrote: > >>> 2009/7/22 Pierre GM : >>> You could try scipy.stats.scoreatpercentile, >>> scipy.stats.mstats.plottingposition or scipy.stats.mstats.mquantiles, >>> which will all approximate quantiles of your distribution. >> >>

Re: [Numpy-discussion] Getting 95%/99% margin of ndarray

2009-07-23 Thread Pierre GM
On Jul 23, 2009, at 6:07 AM, Scott Sinclair wrote: >> 2009/7/22 Pierre GM : >> You could try scipy.stats.scoreatpercentile, >> scipy.stats.mstats.plottingposition or scipy.stats.mstats.mquantiles, >> which will all approximate quantiles of your distribution. > > It seems that mquantiles doesn't d

Re: [Numpy-discussion] Getting 95%/99% margin of ndarray

2009-07-23 Thread Scott Sinclair
> 2009/7/22 Pierre GM : > You could try scipy.stats.scoreatpercentile, > scipy.stats.mstats.plottingposition or scipy.stats.mstats.mquantiles, > which will all approximate quantiles of your distribution. It seems that mquantiles doesn't do what you'd expect when the limit keyword argument is speci

Re: [Numpy-discussion] Getting 95%/99% margin of ndarray

2009-07-22 Thread Citi, Luca
I am afraid I misunderstand your question because I do not get the results you expected. def pdyn(a, p): a = np.sort(a) n = round((1-p) * len(a)) return a[int((n+1)/2)], a[len(a)-1-int(n/2)] # a[-int(n/2)] would not work if n<=1 >>> pdyn([0, 0, 0, 0, 1, 2, 3, 4, 5, 2000], 1) (0, 2000

Re: [Numpy-discussion] Getting 95%/99% margin of ndarray

2009-07-22 Thread Pierre GM
On Jul 22, 2009, at 12:36 PM, Johannes Bauer wrote: > Hello list, > > is there some possibilty to get a p-dynamic of an array, i.e. if p=1 > then the result would be (arr.min(), arr.max()), but if 0 < p < 1, > then > the result is so that the pth percentile of the picture is withing the > range

Re: [Numpy-discussion] Getting 95%/99% margin of ndarray

2009-07-22 Thread Citi, Luca
You can do it "by hand" by sorting the array and taking the corresponding elements or you can use scipy.stats.scoreatpercentile that also interpolates. Best, Luca ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/l

[Numpy-discussion] Getting 95%/99% margin of ndarray

2009-07-22 Thread Johannes Bauer
Hello list, is there some possibilty to get a p-dynamic of an array, i.e. if p=1 then the result would be (arr.min(), arr.max()), but if 0 < p < 1, then the result is so that the pth percentile of the picture is withing the range given? I cannot explain this very well, so please let me illustrate