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

Filter condition is not broadcasted #963

Open
JohanMabille opened this issue Jul 12, 2018 · 0 comments · May be fixed by #1638
Open

Filter condition is not broadcasted #963

JohanMabille opened this issue Jul 12, 2018 · 0 comments · May be fixed by #1638

Comments

@JohanMabille
Copy link
Member

The filter condition is not broadcasted to match the shape of the expression we want to filter. FOr instance, the following code returns all the elements of the first column bigger than the treshold instead of returning all the ellements of lines whose first element is bigger than the treshold:

xarray<int> a = { { 0, 1, 2, 3 },
                  { 4, 5, 6, 7 },
                  { 8, 9, 10, 11 } };
auto filter = xt::filter(a, xt::view(a, xt::all(), 0) > 4);
std::cout << filter << std:endl;

Result:

{ 8 }

Expected result:

{8, 9, 10, 11}
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

Successfully merging a pull request may close this issue.

1 participant