Fwd: Performance feature for np.isin and np.in1d

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Performance feature for np.isin and np.in1d

Miles Cranmer
(Not sure what the right list is for this)

Hi,

I have started a PR for a "fast_integers" flag for np.isin and np.in1d which greatly increases performance when both arrays are integral. It works by creating a boolean array with elements set to 1 where the parent array (ar2) has elements and 0 otherwise. This array is then indexed by the child array (ar1) to create the output.

https://github.com/numpy/numpy/pull/12065

Thoughts on this? Please let me know if you have any questions about my addition.

Thank you.
Best regards,
Miles

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Performance feature for np.isin and np.in1d

Miles Cranmer
Hi,

I was wondering how I could have this PR merged (https://github.com/numpy/numpy/pull/12065)? The discussion on the PR seems to have gone well and all tests pass.

Cheers,
Miles

On Mon, Oct 1, 2018 at 2:36 PM Miles Cranmer <[hidden email]> wrote:
(Not sure what the right list is for this)

Hi,

I have started a PR for a "fast_integers" flag for np.isin and np.in1d which greatly increases performance when both arrays are integral. It works by creating a boolean array with elements set to 1 where the parent array (ar2) has elements and 0 otherwise. This array is then indexed by the child array (ar1) to create the output.

https://github.com/numpy/numpy/pull/12065

Thoughts on this? Please let me know if you have any questions about my addition.

Thank you.
Best regards,
Miles


_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion