home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 121679580

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/issues/475#issuecomment-121679580 https://api.github.com/repos/pydata/xarray/issues/475 121679580 MDEyOklzc3VlQ29tbWVudDEyMTY3OTU4MA== 1217238 2015-07-15T16:58:36Z 2015-07-15T16:58:36Z MEMBER

So, the good news is that once we figure out the API for pointwise indexing, I think the nearest-neighbor part could be as simple as supplying method='nearest'.

The challenge is that we want to go from an DataArray that looks like this:

``` In [4]: arr = xray.DataArray([[1, 2], [3, 4]], dims=['x', 'y'])

In [5]: arr Out[5]: <xray.DataArray (x: 2, y: 2)> array([[1, 2], [3, 4]]) Coordinates: * x (x) int64 0 1 * y (y) int64 0 1 ```

To one that looks like that:

In [6]: xray.DataArray([1, 4], {'x': ('c', [0, 1]), 'y': ('c', [0, 1])}, dims='c') Out[6]: <xray.DataArray (c: 2)> array([1, 4]) Coordinates: y (c) int64 0 1 x (c) int64 0 1 * c (c) int64 0 1

Somehow, we need to figure out the name for the new dimension (c in this example).

My thought would be to have methods sel_points and isel_points that work similarly to sel and isel. This is straightforward if you already have xray 1D objects with a labeled dimension: arr.sel_points(x=x, y=y), where x and y are along the c dimension.

If you don't already have 1D xray objects, I suppose we could also allow arr.sel_points(x=('c', [0, 1]), y=('c', [0, 1])) or arr.sel_points('c', x=[0, 1], y=[0, 1]).

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