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/1332#issuecomment-418161473,https://api.github.com/repos/pydata/xarray/issues/1332,418161473,MDEyOklzc3VlQ29tbWVudDQxODE2MTQ3Mw==,1217238,2018-09-03T16:56:26Z,2018-09-03T16:56:26Z,MEMBER,"I agree that we should have a ""middle"" or ""centered"" option for xarray.diff. On Mon, Sep 3, 2018 at 9:14 AM T. Chor <notifications@github.com> wrote: > I'm not sure where we stand on this issue, but I think since > numpy.gradient already exists, it makes more sense to wrap that function > for the sake of simplicity instead of making xr.diff differ from the > original premise of np.diff. > > On the same topic, it bothers me that xr.diff only accepts ""upper"" and > ""lower"" arguments for the label. The most obvious (and useful) value in > my opinion would be ""middle"", which would correspond to a centered finite > differences. Is there any special reason why that option isn't there? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/pydata/xarray/issues/1332#issuecomment-418154705>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/ABKS1pWdcdpNtLK18J8v6z8AimuBryT_ks5uXVV3gaJpZM4Mq3x-> > . > ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,217385961 https://github.com/pydata/xarray/issues/1332#issuecomment-289858583,https://api.github.com/repos/pydata/xarray/issues/1332,289858583,MDEyOklzc3VlQ29tbWVudDI4OTg1ODU4Mw==,1217238,2017-03-28T18:17:18Z,2017-03-28T18:17:18Z,MEMBER,"As I mentioned in #1288, I think basic functionality like `integrate` and `gradient` is totally within appropriate scope for xarray. I recall now that people have requested similar functionality for `numpy.diff`: https://github.com/numpy/numpy/issues/8132. It would be nice to resolve this upstream in NumPy first (e.g., with https://github.com/numpy/numpy/pull/8206), and then simply copy the API design in xarray.","{""total_count"": 2, ""+1"": 2, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,217385961 https://github.com/pydata/xarray/issues/1332#issuecomment-289671227,https://api.github.com/repos/pydata/xarray/issues/1332,289671227,MDEyOklzc3VlQ29tbWVudDI4OTY3MTIyNw==,1217238,2017-03-28T05:56:57Z,2017-03-28T05:56:57Z,MEMBER,"Would it fill the same need to add a wrapped version of `np.gradient`, which already works similarly to `diff` but preserves input shape?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,217385961