-
Notifications
You must be signed in to change notification settings - Fork 401
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
Different from numpy? #1716
Comments
Can you post your numpy code please? |
@JohanMabille numpy code
|
auto indices = argwhere<L>(std::forward<O>(condition));
using view_type = xindex_view<xclosure_t<E>, decltype(indices)>;
return view_type(std::forward<E>(e), std::move(indices)); That is, the selected elements in the view have the same indices as the true elements in the condition. Usually you don't need to bother with the implementation detial because the condition depends on the expression you want to filter: auto f = filter(a, a >= 5); So here the condition ( In your case, the condition and the expression that you want to filter do not have the same shape, and there is a bug in the filter implementation where the condition is not broadcasted (see #963 ). xt::filter(aad, {{true, false}, {true, false}}) = 0; resulting in {{0, 2},
{0, 5}} So it will still be different from Numpy. |
I got it. Thx |
c++ code:
result:
in numpy:
The text was updated successfully, but these errors were encountered: