html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/2028#issuecomment-1423154722,https://api.github.com/repos/pydata/xarray/issues/2028,1423154722,IC_kwDOAMm_X85U054i,13985417,2023-02-08T19:47:22Z,2023-02-08T19:47:22Z,NONE,"Thanks, @benbovy. Yep, the kdtree objects don't like the range based slices. xoak has worked well in the past though. I'll keep an eye on xoak-xarray integration.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,309691307 https://github.com/pydata/xarray/issues/2028#issuecomment-1422003293,https://api.github.com/repos/pydata/xarray/issues/2028,1422003293,IC_kwDOAMm_X85Uwgxd,13985417,2023-02-08T04:52:23Z,2023-02-08T04:52:23Z,NONE,"Thanks @benbovy, it works well. I am curious about using set_xindex with 2-dimensional non-index coordinates. A use case could be datasets with `x` and `y` coordinates that need to be subset using `longitude (x,y)` and `latitude (x,y)` values. Any suggestions?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,309691307 https://github.com/pydata/xarray/issues/2028#issuecomment-1421060924,https://api.github.com/repos/pydata/xarray/issues/2028,1421060924,IC_kwDOAMm_X85Us6s8,103256364,2023-02-07T16:28:53Z,2023-02-07T16:28:53Z,NONE,"What about slices? My non-index coord is a datetime, and I need to select between two dates.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,309691307 https://github.com/pydata/xarray/issues/2028#issuecomment-1203169477,https://api.github.com/repos/pydata/xarray/issues/2028,1203169477,IC_kwDOAMm_X85HtujF,1542825,2022-08-02T20:13:41Z,2022-08-02T20:13:41Z,NONE,Exciting news!! Thanks for the quick response and the huge amount of work on explicit indexes. I'll be excited and grateful to enjoy the public API once it comes into its own :),"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,309691307 https://github.com/pydata/xarray/issues/2028#issuecomment-1202434941,https://api.github.com/repos/pydata/xarray/issues/2028,1202434941,IC_kwDOAMm_X85Hq7N9,1542825,2022-08-02T12:35:00Z,2022-08-02T12:35:00Z,NONE,"Hi all, wanted to ask what the status of this feature request is given all of the recent work by @benbovy on explicit indexes.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,309691307 https://github.com/pydata/xarray/issues/2028#issuecomment-1146877847,https://api.github.com/repos/pydata/xarray/issues/2028,1146877847,IC_kwDOAMm_X85EW_eX,5347026,2022-06-05T20:24:20Z,2022-06-05T20:24:20Z,NONE,"> I agree this is harder that it should be. > > Here's one way: > > ```python > In [28]: a.where(a.currency=='EUR', drop=True) > Out[28]: > <xarray.DataArray (country: 2)> > array([20., 30.]) > Coordinates: > * country (country) <U7 'Germany' 'France' > currency (country) <U3 'EUR' 'EUR' > ``` > > I'm not sure whether `.sel` should work for non-`IndexVariables` - thoughts? @max-sixty , perhaps there is any update on OPs question or maybe you can help to achieve the following? I would like `sel based on a non-dim coordinate` to be as fast as `sel based on the dim itself`. Timings: ```python # sel based on a non-dim coordinate # (using this coordinate directly .sel(product_id=26) would result in error ""'no index found for coordinate product_id"") %timeit xds.sel(product=xds.product_id==26) 1.54 ms ± 64.2 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) # sel based on the dim itself %timeit xds.sel(product='GN91 Glove Medium') 499 µs ± 16.1 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) %timeit xds.where(xds.product_id==26, drop=True) 4.17 ms ± 39 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) ``` Anyways, _xarray_ is brilliant and made my week :)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,309691307 https://github.com/pydata/xarray/issues/2028#issuecomment-921926536,https://api.github.com/repos/pydata/xarray/issues/2028,921926536,IC_kwDOAMm_X84283uI,13985417,2021-09-17T16:27:14Z,2021-09-17T16:31:55Z,NONE,"@dcherian any recoomendations for 2D non-dim coords? I would like to subset a dataarray based on slices for `x` and `y` coordinates <img width=""815"" alt=""Screen Shot 2021-09-17 at 12 26 39 PM"" src=""https://user-images.githubusercontent.com/13985417/133822157-7ee98674-53cc-4ed7-ba1b-627ac97fd161.png"">","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,309691307 https://github.com/pydata/xarray/issues/2028#issuecomment-613802224,https://api.github.com/repos/pydata/xarray/issues/2028,613802224,MDEyOklzc3VlQ29tbWVudDYxMzgwMjIyNA==,18236610,2020-04-15T03:58:35Z,2020-04-15T03:58:52Z,NONE,"I am a little confused about the documentation relating to this issue. It says in the documentation at http://xarray.pydata.org/en/stable/data-structures.html#coordinates ""non-dimension coordinates are variables that contain coordinate data, but are not a dimension coordinate. They can be multidimensional (see Working with Multidimensional Coordinates), and there is no relationship between the name of a non-dimension coordinate and the name(s) of its dimension(s). Non-dimension coordinates can be **useful for indexing** or plotting; otherwise, xarray does not make any direct use of the values associated with them. They are not used for alignment or automatic indexing, nor are they required to match when doing arithmetic (see Coordinates)."" Is this an issue that has been resolved, and if so an example on how to do this would be helpful in the documentation. If not, should the documentation be corrected?","{""total_count"": 2, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 2}",,309691307 https://github.com/pydata/xarray/issues/2028#issuecomment-592100301,https://api.github.com/repos/pydata/xarray/issues/2028,592100301,MDEyOklzc3VlQ29tbWVudDU5MjEwMDMwMQ==,26384082,2020-02-27T18:11:35Z,2020-02-27T18:11:35Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here or remove the `stale` label; otherwise it will be marked as closed automatically ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,309691307