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 <joseph.jazz.bolton@gmail.com> wrote:
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 this concept extends to an arbitrary number of dimensions. 

Is this a feature that would benefit the numpy package? I am happy to code it up.

Thanks for your time! 

Best regards 
Joe 




_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-leave@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: jfoxrabinovitz@gmail.com