issues: 507211596
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
507211596 | MDU6SXNzdWU1MDcyMTE1OTY= | 3399 | With sel_points deprecated, how do you replace it? | 13906519 | closed | 0 | 2 | 2019-10-15T12:27:54Z | 2019-10-15T13:55:48Z | 2019-10-15T13:55:48Z | NONE | MCVE Code Sample```python import numpy as np import xarray as xr da = xr.DataArray(np.arange(16).reshape((4,4)), coords=[('lat', [40,45,50,55]), ('lon', [5,10,15,20])]) points = da.sel_points(lat=[40.1, 42.3, 39.78], lon=[7.1, 6.2, 13.2], method='nearest') for p in points: print(p) ``` Expected OutputThis works fine < 0.13, but is now deprecated. I don't know (and cannot find an example in the docs) how one would replicate this with vectorised indexing?!? I have to iterate over the returned points as each will be exported into an XML element. Note, that in my real code I work with a xr.Dataset with many variables instead of a simple 2d xr. DataArray) Problem DescriptionI think this deprecation and the current docs will trip a lot of users using sel_points/ isle_points. Any example how to replace the code with the current API is highly appreciated! Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3399/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |