home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 203691509

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/811#issuecomment-203691509 https://api.github.com/repos/pydata/xarray/issues/811 203691509 MDEyOklzc3VlQ29tbWVudDIwMzY5MTUwOQ== 1217238 2016-03-31T00:08:39Z 2016-03-31T00:08:39Z MEMBER

If I'm understanding you correctly, the use case is to trim off all NA regions when using where for selection. If your mask is not perfectly rectangular, some values will still be replaced with NA.

A starting point would be something like this:

python def sel_where(data, mask): data, mask = xr.broadcast(xr.align(data, mask, join='left', copy=False)) # possibly not a good idea to expand mask to the full dimensions of the data indexes = tuple(mask.any(dim).values for dim in mask.dims) return data[indexes].where(mask[indexes])

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