Skip to content

Masking DataArrays and modifying values based on dimensions #6426

Answered by dcherian
VeckoTheGecko asked this question in Q&A
Discussion options

You must be logged in to vote

Can you try the top level where function: https://docs.xarray.dev/en/stable/generated/xarray.where.html

land_flag = xr.where(ds.lon < 15, True, False)

Replies: 1 comment 1 reply

Comment options

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

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