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

2022-02-22 Thread Joseph Bolton
Morning, My apologies if this deviates from the vision of numpy: 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 these are inelegant. I am thinking of 1-dimensional arrays, but

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

2022-02-23 Thread Joseph Bolton
ase of tied values (e.g. "first appearance", "random" etc.). Cheers Joe On Tue, 22 Feb 2022 at 15:30, Joseph Fox-Rabinovitz < jfoxrabinov...@gmail.com> wrote: > Joe, > > Could you show an example that you find inelegant and elaborate on how you > intend t