Replies: 2 comments
-
you're looking for In [1]: import xarray as xr
...:
...: arr = xr.DataArray([1, 2, 3], dims=("x",), coords={"a": 1, "x": [10, 20, 30], "b": 2})
...: display(arr)
...: arr.drop_vars(["a", "b"])
<xarray.DataArray (x: 3)>
array([1, 2, 3])
Coordinates:
a int64 1
* x (x) int64 10 20 30
b int64 2
Out[1]:
<xarray.DataArray (x: 3)>
array([1, 2, 3])
Coordinates:
* x (x) int64 10 20 30 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a DataArray with many single-valued coordinates as a result of multiple
.sel
's. Now I want to eliminate all coordinates that doesn't have a corresponding dimension. How can I do this? An example:Beta Was this translation helpful? Give feedback.
All reactions