Skip to content

Remove all values from xarray based on values of another list. #7417

Answered by jhamman
sagunkayastha asked this question in Q&A
Discussion options

You must be logged in to vote

You can use DataArray.isin for this:

da.where(~da.isin([0, 1,23,45, ...]))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sagunkayastha
Comment options

Answer selected by sagunkayastha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants