pandas.Series has a nlargest/nsmallest method that might be upstream-able.

On Wed, Feb 23, 2022 at 6:28 AM Friedrich Romstedt <
[email protected]> wrote:

> Am Di., 22. Feb. 2022 um 14:25 Uhr schrieb Joseph Bolton
> <[email protected]>:
> >
> > 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/[email protected]/thread/F4P5UVTAKRJJ3OORI6UOWFSUEE5CNTSC/
>
> Mentioned in that thread is the following pull request, which has some
> more discussion:
>
> https://github.com/numpy/numpy/pull/19117
>
> Friedrich
> _______________________________________________
> NumPy-Discussion mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: [email protected]
>
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: [email protected]

Reply via email to