[Numpy-discussion] Re: Feature query: fetch top/bottom k from array

2022-02-23 Thread Brock Mendel
pandas.Series has a nlargest/nsmallest method that might be upstream-able. On Wed, Feb 23, 2022 at 6:28 AM Friedrich Romstedt < friedrichromst...@gmail.com> wrote: > Am Di., 22. Feb. 2022 um 14:25 Uhr schrieb Joseph Bolton > : > > > > I find myself often requiring the indices and/or values of the

[Numpy-discussion] Re: Feature query: fetch top/bottom k from array

2022-02-23 Thread Friedrich Romstedt
Am Di., 22. Feb. 2022 um 14:25 Uhr schrieb Joseph Bolton : > > I find myself often requiring the indices and/or values of the top (or > bottom) k items in a numpy array. There has been discussion about this last year: https://mail.python.org/archives/list/numpy-discussion@python.org/thread/F4P5U

[Numpy-discussion] Re: Feature query: fetch top/bottom k from array

2022-02-23 Thread Joseph Bolton
Morning! I find myself often requiring the indices and/or values of the top (or bottom) k items in a numpy array. I am aware of solutions involving *partition*/*argpartition *but I find these inelegant (or using *sort *but these are inefficient). Is this a feature that would benefit the numpy pac

[Numpy-discussion] Re: Feature query: fetch top/bottom k from array

2022-02-22 Thread Joseph Fox-Rabinovitz
Joe, Could you show an example that you find inelegant and elaborate on how you intend to improve it? It's hard to discuss without more specific information. - Joe On Tue, Feb 22, 2022, 07:23 Joseph Bolton wrote: > Morning, > > My apologies if this deviates from the vision of numpy: > > I find