Skip to content

ENH: add setdiff1d #34

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

Closed
lucascolley opened this issue Nov 21, 2024 · 6 comments · Fixed by #35
Closed

ENH: add setdiff1d #34

lucascolley opened this issue Nov 21, 2024 · 6 comments · Fixed by #35
Labels
enhancement New feature or request new function

Comments

@lucascolley
Copy link
Member

These functions look like the most obvious candidates for this library from scikit-learn: https://github.com/scikit-learn/scikit-learn/blob/439ea045ad44e6a09115dc23e9bf23db00ff41de/sklearn/utils/_array_api.py#L931-L982

cc @OmarManzoor @ogrisel @betatim

@lucascolley lucascolley added enhancement New feature or request new function labels Nov 21, 2024
@lucascolley
Copy link
Member Author

One problem is that these functions make use of device from array-api-compat. Either we need to restrict support in this library to array objects with the device attribute, or we vendor (copy) device and the functions it calls from array-api-compat.

@asmeurer
Copy link
Member

I would propose isin for inclusion in the standard.

@lucascolley
Copy link
Member Author

any thoughts on setdiff1d @asmeurer ?

@asmeurer
Copy link
Member

asmeurer commented Nov 22, 2024

I've never even heard of that function before. I guess if it has a lot of usage it could be proposed too, but otherwise I would assume it's a more niche function that would be more appropriate for this package. Also, isn't it straightforward to implement in terms of isin if that were added (though perhaps inefficiently)?

@lucascolley
Copy link
Member Author

In scikit-learn they implement both in terms of in1d

@rgommers
Copy link
Member

I'd also say that setdiff1d is too niche to consider for the standard. Adding it to array-api-extra seems like a better option.

@lucascolley lucascolley changed the title ENH: add isin, setdiff1d ENH: add setdiff1d Nov 23, 2024
@lucascolley lucascolley linked a pull request Nov 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new function
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants