Skip to content

How can I only keep data in one xarray for entries that match a specific dimension in another xarray? #7567

Closed Answered by benoitespinola
benoitespinola asked this question in Q&A
Discussion options

You must be logged in to vote

After a lot of research, trial and error, I got it to work as follow:

ds1 = ds1.where(ds1.time.isin(ds2.time), drop=True)

Replies: 1 comment 1 reply

Comment options

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

Answer selected by benoitespinola
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