issue_comments: 124192448
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/490#issuecomment-124192448 | https://api.github.com/repos/pydata/xarray/issues/490 | 124192448 | MDEyOklzc3VlQ29tbWVudDEyNDE5MjQ0OA== | 1217238 | 2015-07-23T18:16:06Z | 2015-07-23T18:16:06Z | MEMBER | I agree, this would be useful. Probably should take a I guess ``` python In [28]: x = xray.Dataset({'foo': ('x', [5, 5, 6, 6])}) In [29]: start = x.isel(x=slice(None, -1)) In [30]: end = x.isel(x=slice(1, None)) In [31]: start.coords['x'] = end.coords['x'] In [32]: end - start Out[32]: <xray.Dataset> Dimensions: (x: 3) Coordinates: * x (x) int64 1 2 3 Data variables: foo (x) int64 0 1 0 ``` Since this logic is the same for Dataset and DataArray objects, it could live as a method on If you find yourself needing to write dataset or dataarray specific logic, write it as a Dataset method and follow the example of DataArray.swap to extend it to dataarrays: https://github.com/xray/xray/blob/v0.5.2/xray/core/dataarray.py#L659 |
{
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
96844263 |