[Numpy-discussion] Added Rivest-Floyd selection algorithm as an option to numpy.partition

Ralf Gommers ralf.gommers at gmail.com
Thu Nov 26 18:10:00 EST 2020


On Tue, Nov 24, 2020 at 12:56 PM Виктория Малясова <
malyasova.viktoriya at yandex.ru> wrote:

> Hello everyone!
>
> I've implemented the Rivest-Floyd selection algorithm as a second option
> to the partition method. I found it works about 1.5 times faster on average
> for big array sizes; here are average times for finding a median:
>
> array length  10
> introselect 4.6e-05
> rivest_floyd 4.4e-05
> array length  100
> introselect 5.5e-05
> rivest_floyd 4.7e-05
> array length  1000
> introselect 6.9e-05
> rivest_floyd 6.5e-05
> array length  10000
> introselect 3.1e-04
> rivest_floyd 2.3e-04
> array length  100000
> introselect 2.9e-03
> rivest_floyd 2.0e-03
> array length  1000000
> introselect 2.9e-02
> rivest_floyd 2.0e-02
>
> I've created a pull request https://github.com/numpy/numpy/pull/17813 and implemented reviewer's suggestions and fixes. Do you think this feature should be added? I am new to open source, sorry if I am doing anything wrong.
>
>
Hi Viktoriya, welcome! It looks like you're doing everything right, and the
reviews so far are positive.

Cheers,
Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20201126/02373884/attachment-0001.html>


More information about the NumPy-Discussion mailing list