Skip to content

return empty array if boolean index array is all False#1198

Merged
jswhit merged 3 commits into
masterfrom
boolFalse_getitem
Oct 16, 2022
Merged

return empty array if boolean index array is all False#1198
jswhit merged 3 commits into
masterfrom
boolFalse_getitem

Conversation

@jswhit
Copy link
Copy Markdown
Collaborator

@jswhit jswhit commented Oct 11, 2022

alternative to PR #1197

@jswhit
Copy link
Copy Markdown
Collaborator Author

jswhit commented Oct 11, 2022

Behavior is consistent with numpy. Also, indexing 1d variables with boolean index arrays that are all False already return empty arrays (but for variables with more than one dimension an exception is raised). With this PR the behavior for multi-dim variables is consistent with the current behavior for 1d variables (and slicing numpy arrays)

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 this pull request may close these issues.

1 participant