-
Notifications
You must be signed in to change notification settings - Fork 311
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
Sub (and Add, Div, etc) not implemented for ArrayView/ViewRepr? #743
Comments
For arithmetic operations, adding For elementwise comparison of values, we can't provide direct support for the normal comparison operators ( I wouldn't mind adding elementwise comparison support (using methods, since we can't do it using the normal operators) so that |
Oh, right you are! I read that section multiple times and I thought I had tried that before making an issue, but I guess I was wrong. Thanks for the tip! I think element-wise comparisons would be pretty handy as convenience functions. Or if that's deemed unnecessary it would be a worthy addition to the "ndarray_for_numpy_users" doc. |
Hi! I wanted to report that I find this to be a barrier to using this library in practice. I read the docs and knew it was only implemented for certain combinations of references, views, etc... but it was quite hard to figure out the right pairs in practice since all the error would say is that trait bounds weren't satisfied. Additionally, I ended up with a very unsatisfactory solution to what should be a very simple, and common, operation. Given a I would like to do |
@xldenis That is a good point, but I will note that the situation is the same for |
Yea I think the problem is really that the error message is worse in the case of |
First off, very impressed with this crate so far. I'm a long-time numpy user and I appreciate the task you took on on behalf of the Rust ecosystem.
I only recently started using Rust, so I might just be trying to do the wrong thing here, but I'm curious why an
ArrayView
can not be used on the LHS of a binary operation like+
,-
, etc. That seems like a natural use-case, since you need a read-only view of the data in the array but won't be modifying it.In my case I'd like to compare an array of values to a particular query by broadcasting and then operate on the matching rows later–this means I can't consume the array in this operation*.
Is the appropriate thing to
Zip
over the rows and compare them that way? I can see how to do that but it seemed verbose, so I thought I'd check. And if this is an oversight I can try to help implement a PR.* a broadcasting comparison operator would be even better for this but the existence of #35 suggests that might be difficult.
The text was updated successfully, but these errors were encountered: