Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread Benjamin Root
to be honest, I read "topk" as "topeka", but I am weird. While numpy doesn't use underscores all that much, I think this is one case where it makes sense. I'd also watch out for the use of the term "sorted", as it may mean different things to different people, particularly with regards to what

Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread kangkai
> > > On Fri, May 28, 2021 at 4:58 PM > wrote: > > Hi all, > > Finding topk elements is widely used in several fields, but missed > in NumPy. > I implement this functionality named as numpy.topk using core numpy > functions and open a PR: >

Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread Neal Becker
Topk is a bad choice imo. I initially parsed it as to_pk, and had no idea what that was, although sounded a lot like a scipy signal function. Nlargest would be very obvious. On Sun, May 30, 2021, 7:50 AM Alan G. Isaac wrote: > Mathematica and Julia both seem relevant here. > Mma has

Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread Alan G. Isaac
Mathematica and Julia both seem relevant here. Mma has TakeLargest (and Wolfram tends to think hard about names). https://reference.wolfram.com/language/ref/TakeLargest.html Julia's closest comparable is perhaps partialsortperm:

Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread Alan G. Isaac
Is there any thought of allowing for other comparisons? In which case `last_k` might be preferable. Alan Isaac On 5/30/2021 2:38 AM, Ilhan Polat wrote: I think "max_k" is a good generalization of the regular "max". ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread Daniele Nicolodi
On 30/05/2021 00:48, Robert Kern wrote: > On Sat, May 29, 2021 at 3:35 PM Daniele Nicolodi > wrote: > > What does k stand for here? As someone that never encountered this > function before I find both names equally confusing. If I understand > what the

Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread Matti Picus
On 29/5/21 5:28 pm, Ralf Gommers wrote: On Fri, May 28, 2021 at 4:58 PM > wrote: Hi all, Finding topk elements is widely used in several fields, but missed in NumPy. I implement this functionality named asĀ  numpy.topk using core numpy

Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread Ilhan Polat
after a coffee, I don't see the point of calling it still "k" so "max_n" is my vote for what its worth. On Sun, May 30, 2021 at 8:38 AM Ilhan Polat wrote: > Since this going into the top namespace, I'd also vote against the > matlab-y "topk" name. And even matlab didn't do what I would expect

Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread Ilhan Polat
Since this going into the top namespace, I'd also vote against the matlab-y "topk" name. And even matlab didn't do what I would expect and went with maxk https://nl.mathworks.com/help/matlab/ref/maxk.html I think "max_k" is a good generalization of the regular "max". Even when auto-completing,