-
|
Hello, I have a dataset with the following dimensions and coordinates: and I would like to use the sel() method using as reference the 'field' coordinate (linked to the 'field_n' dimension) to filter a dataset. However when I try to do, for example: Dimensions {'field'} do not exist. Expected one or more of ('current', 'field_n') I confirmed that selecting using 'field_n' works perfectly: I am guessing that using sel() for coordinates and not dimensions is not supported or requires some extra step? Thank you a lot in advace for your help, and thanks for the amazing work in developing xarray!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
If you truly want label-based indexing (it looks like you created an index for |
Beta Was this translation helpful? Give feedback.
iselonly works on dimensions (anything inds.dims), and is used for position-based indexing.If you truly want label-based indexing (it looks like you created an index for
field_n), I think you'll have to use.sel(i.e. maybe this is a typo?).