Skip to content

Introduce if ufunc and rebase the three-argument where on it #10654

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
hameerabbasi opened this issue Feb 24, 2018 · 1 comment
Closed

Introduce if ufunc and rebase the three-argument where on it #10654

hameerabbasi opened this issue Feb 24, 2018 · 1 comment

Comments

@hameerabbasi
Copy link
Contributor

hameerabbasi commented Feb 24, 2018

Over at pydata/sparse#102, I ran into some issues about not being able to override where. I was thinking that if there was an if ufunc (suggestions for better names welcome) which selected from either x2 or x3 depending on x1, and made where call that, it would make overriding the three-argument version of where much simpler.

The slight problem I see with this is the following: where currently returns an ndarray, even for scalars. Maybe it'd be better if it decayed 0-d combinations to scalars anyway? I believe so.

Over the long term we might have __array_where__ but for the short term, using existing machinery, this will do.

@hameerabbasi
Copy link
Contributor Author

hameerabbasi commented Feb 24, 2018

I see that there is already an issue for this. (#8994)

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

No branches or pull requests

1 participant