Skip to content

set value where the condition is true #4951

Answered by keewis
raybellwaves asked this question in Q&A
Discussion options

You must be logged in to vote

wouldn't xr.where work:

xr.where(da < 4, 1, np.nan)

unless you want to keep the values of da for x <= 3? For that you would probably need the 2 step approach

Replies: 1 comment 1 reply

Comment options

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

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