Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding __array_function__ support to random operations (like shuffle) #15123

Open
jakirkham opened this issue Dec 17, 2019 · 3 comments
Open

Comments

@jakirkham
Copy link
Contributor

It would be really useful when operating with other array libraries to support __array_function__ on numpy.random functions (like shuffle) so as to dispatch to other implementations for those arrays.

@jakirkham
Copy link
Contributor Author

Any thoughts on whether this would be ok to do?

@rgommers
Copy link
Member

rgommers commented Jan 7, 2020

It looks to me like there are three functions for which this would make sense: shuffle, choice and permutation. Those operate on an existing array rather than generating a new one from some input parameters.

+0.5 from me

@mikeiovine
Copy link

Hi all,
I noticed that this issue is quite old, but I was messing around recently and wanted to provide a custom implementation of shuffle for my ndarray subclass. I made some simple changes and opened a PR. Hope this is OK, suggestions welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants