home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 326778667

This data as json

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/pull/1473#issuecomment-326778667 https://api.github.com/repos/pydata/xarray/issues/1473 326778667 MDEyOklzc3VlQ29tbWVudDMyNjc3ODY2Nw== 6815844 2017-09-03T01:30:49Z 2017-09-03T02:00:46Z MEMBER

for inexact indexing (e.g., method='nearest'), the result of reindex copies the index from the indexers, whereas the result of sel copies the index from the object being indexed

Yes, this is another difference, but if the indexer of sel has a coordinate, the behavior becomes closer to reindex.

I don't know quite what it would mean to reindex with a multi-dimensional indexer

I thought this when working with the power-user example,

It would be really nice to also have a power-user example of pointwise indexing with 2D indexers and nearest-neighbor lookups, e.g., to switch to another coordinate projection. Something like ds.sel(latitude=latitude_grid, longitude=longitude_grid, method='nearest', tolerance=0.1).

As this example, I considered the rasm data, where the original object stays on the logical coordinates x and y. If we have conversion DataArrays, such as a table of x and y values as a function of target coordinates lat and lon, then the coordinate projection from (x, y) to (lat, lon) can be done by .sel(x=x, y=y, method='nearest'). This might be a kind of multi-dimensional reindex?

In such a use case, it would be better for sel (or multi-dimensional reindex) to return NaN than to raise an error.

From a practical perspective, writing a version of vectorized indexing that fills in NaN could be non-trivial.

I agree. I also would like to try that, but it might be a bit tough and it would be better to do after the next release.

Maybe I need to switch to much easier task in this example. Do you have any suggestion?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  241578773
Powered by Datasette · Queries took 1.9ms · About: xarray-datasette