issue_comments: 253683651
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/1017#issuecomment-253683651 | https://api.github.com/repos/pydata/xarray/issues/1017 | 253683651 | MDEyOklzc3VlQ29tbWVudDI1MzY4MzY1MQ== | 1217238 | 2016-10-14T01:13:30Z | 2016-10-14T01:13:30Z | MEMBER | @benbovy This is actually a good use case for no dimension labels. E.g., from my working branch: ``` In [7]: da = xr.DataArray(z, dims=('x', 'y'), name='z') In [8]: dz_dx_xarray = da[1:, :] - da[:-1, :] In [9]: dz_dx dz_dx_numpy dz_dx_xarray In [9]: dz_dx_xarray Out[9]: <xarray.DataArray 'z' (x: 4, y: 5)> array([[ 0.15224392, -0.03428312, -0.10936435, 0.06149288, -0.69317859], [-0.61928605, 0.71636887, -0.05578677, -0.39489466, 0.63472963], [ 0.05180684, -0.72471438, 0.64259117, 0.24830877, -0.24006862], [ 0.44981358, 0.19054462, -0.69880118, -0.20120161, 0.08580928]]) In [10]: da.diff('x') Out[10]: <xarray.DataArray 'z' (x: 4, y: 5)> array([[ 0.15224392, -0.03428312, -0.10936435, 0.06149288, -0.69317859], [-0.61928605, 0.71636887, -0.05578677, -0.39489466, 0.63472963], [ 0.05180684, -0.72471438, 0.64259117, 0.24830877, -0.24006862], [ 0.44981358, 0.19054462, -0.69880118, -0.20120161, 0.08580928]]) ``` This does depend on the details of how
The (theoretical) benefit would be an easier transition, because previously As I'm working through porting xarray's test suite, I'm realizing that this may not be the best approach. If a user is relying on Either way, the functionality in your |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
179052741 |