home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 421676579

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/1613#issuecomment-421676579 https://api.github.com/repos/pydata/xarray/issues/1613 421676579 MDEyOklzc3VlQ29tbWVudDQyMTY3NjU3OQ== 98330 2018-09-16T02:39:50Z 2018-09-16T02:39:50Z NONE

In case it helps anyone else, I ended up doing: ``` # Note that xarray is fiddly with indexing - if x or y values are ordered # high to low, then the slice bounds need to be reversed. So check that x_ordered_low2high = data.x.values[-1] - data.x.values[0] > 0 y_ordered_low2high = data.y.values[-1] - data.y.values[0] > 0

if x_ordered_low2high:
    x_index = slice(lower_lon, upper_lon)
else:
    x_index = slice(upper_lon, lower_lon)

if y_ordered_low2high:
    y_index = slice(lower_lat, upper_lat)
else:
    y_index = slice(upper_lat, lower_lat)

subset = data.sel(x=x_index, y=y_index)

```

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