Re: [Numpy-discussion] quantile() or percentile()

2017-08-14 Thread Chris Barker
+1 on quantile() -CHB On Sun, Aug 13, 2017 at 6:28 AM, Charles R Harris wrote: > > > On Thu, Aug 10, 2017 at 3:08 PM, Eric Wieser > wrote: > >> Let’s try and keep this on topic - most replies to this message has been >> about #9211, which is an orthogonal issue. >> >> There are two main quest

Re: [Numpy-discussion] quantile() or percentile()

2017-08-13 Thread josef . pktd
On Sun, Aug 13, 2017 at 9:28 AM, Charles R Harris wrote: > > > On Thu, Aug 10, 2017 at 3:08 PM, Eric Wieser > wrote: > >> Let’s try and keep this on topic - most replies to this message has been >> about #9211, which is an orthogonal issue. >> >> There are two main questions here: >> >>1. Wo

Re: [Numpy-discussion] quantile() or percentile()

2017-08-13 Thread Charles R Harris
On Thu, Aug 10, 2017 at 3:08 PM, Eric Wieser wrote: > Let’s try and keep this on topic - most replies to this message has been > about #9211, which is an orthogonal issue. > > There are two main questions here: > >1. Would the community prefer to use np.quantile(x, 0.25) instead of > np.perc

Re: [Numpy-discussion] quantile() or percentile()

2017-08-10 Thread Juan Nunez-Iglesias
I concur with the consensus. On 10 Aug 2017, 11:10 PM +0200, Eric Wieser , wrote: > Let’s try and keep this on topic - most replies to this message has been > about #9211, which is an orthogonal issue. > There are two main questions here: > > 1. Would the community prefer to use np.quantile(x, 0

Re: [Numpy-discussion] quantile() or percentile()

2017-08-10 Thread Eric Wieser
Let’s try and keep this on topic - most replies to this message has been about #9211, which is an orthogonal issue. There are two main questions here: 1. Would the community prefer to use np.quantile(x, 0.25) instead of np.percentile(x, 25), if they had the choice 2. Is this desirable en

Re: [Numpy-discussion] quantile() or percentile()

2017-08-04 Thread Joseph Fox-Rabinovitz
I will go over your PR carefully to make sure we can agree on a matching API. After that, we can swap the backend out whenever I get around to it. Thanks for working on this. -Joe On Thu, Aug 3, 2017 at 5:36 PM, Chun-Wei Yuan wrote: > Cool. Just as a heads up, for my algorithm to work, I a

Re: [Numpy-discussion] quantile() or percentile()

2017-08-03 Thread Chun-Wei Yuan
Cool. Just as a heads up, for my algorithm to work, I actually need the indices, which is why argsort() is so important to me. I use it to get both ap_sorted and ws_sorted variables. If your weighted-quantile algo is faster and doesn't require those indices, please by all means change my impleme

Re: [Numpy-discussion] quantile() or percentile()

2017-08-03 Thread Joseph Fox-Rabinovitz
Not that I know of. The algorithm is very simple, requiring a relatively small addition to the current introselect algorithm used for `np.partition`. My biggest hurdle is figuring out how the calling machinery really works so that I can figure out which input type permutations I need to generate, a

Re: [Numpy-discussion] quantile() or percentile()

2017-08-03 Thread Chun-Wei Yuan
Any way I can help expedite this? On Fri, Jul 21, 2017 at 4:42 PM, Chun-Wei Yuan wrote: > That would be great. I just used np.argsort because it was familiar to > me. Didn't know about the C code. > > On Fri, Jul 21, 2017 at 3:43 PM, Joseph Fox-Rabinovitz < > jfoxrabinov...@gmail.com> wrote: >

Re: [Numpy-discussion] quantile() or percentile()

2017-07-21 Thread Chun-Wei Yuan
That would be great. I just used np.argsort because it was familiar to me. Didn't know about the C code. On Fri, Jul 21, 2017 at 3:43 PM, Joseph Fox-Rabinovitz < jfoxrabinov...@gmail.com> wrote: > While #9211 is a good start, it is pretty inefficient in terms of the fact > that it performs an O

Re: [Numpy-discussion] quantile() or percentile()

2017-07-21 Thread Joseph Fox-Rabinovitz
While #9211 is a good start, it is pretty inefficient in terms of the fact that it performs an O(nlogn) sort of the array. It is possible to reduce the time to O(n) by using a similar partitioning algorithm to the one in the C code of percentile. I will look into it as soon as I can. -Joe On

Re: [Numpy-discussion] quantile() or percentile()

2017-07-21 Thread Chun-Wei Yuan
Just to provide some context, 9213 actually spawned off of this guy: https://github.com/numpy/numpy/pull/9211 which might address the weighted inputs issue Joe brought up. C On Fri, Jul 21, 2017 at 2:21 PM, Joseph Fox-Rabinovitz < jfoxrabinov...@gmail.com> wrote: > I think that there would be

Re: [Numpy-discussion] quantile() or percentile()

2017-07-21 Thread Joseph Fox-Rabinovitz
I think that there would be a very good reason to have a separate function if we were to introduce weights to the inputs, similarly to the way that we have mean and average. This would have some (positive) repercussions like making weighted histograms with the Freedman-Diaconis binwidth estimator a

[Numpy-discussion] quantile() or percentile()

2017-07-21 Thread Chun-Wei Yuan
There's an ongoing effort to introduce quantile() into numpy. You'd use it just like percentile(), but would input your q value in probability space (0.5 for 50%): https://github.com/numpy/numpy/pull/9213 Since there's a great deal of overlap between these two functions, we'd like to solicit opi