-
|
Beta Was this translation helpful? Give feedback.
Answered by
keewis
Jan 12, 2021
Replies: 1 comment 1 reply
-
not sure if there's a better way to do this, but you can combine the expressions and use da = (
da.stack({"index": ("lat", "lon")})
.dropna("index")
.reset_index("index")
.assign_coords({"index": lambda x: np.arange(x.sizes["index"])})
) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ahuang11
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
not sure if there's a better way to do this, but you can combine the expressions and use
da.sizes["index"]
instead oflen(da["index"])
: