Skip to content

Commit 7b57c68

Browse files
max-sixtyMaximilian Roos
authored andcommitted
Add note on diff differing from pandas
1 parent 18e34cc commit 7b57c68

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

xarray/core/dataarray.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2693,6 +2693,8 @@ def diff(self, dim: Hashable, n: int = 1, label: Hashable = "upper") -> "DataArr
26932693
difference : same type as caller
26942694
The n-th order finite difference of this object.
26952695
2696+
.. note:: `n` matches numpy's behavior and is different from pandas'
2697+
26962698
Examples
26972699
--------
26982700
>>> arr = xr.DataArray([5, 5, 6, 6], [[1, 2, 3, 4]], ['x'])

xarray/core/dataset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4879,6 +4879,8 @@ def diff(self, dim, n=1, label="upper"):
48794879
difference : same type as caller
48804880
The n-th order finite difference of this object.
48814881
4882+
.. note:: `n` matches numpy's behavior and is different from pandas'
4883+
48824884
Examples
48834885
--------
48844886
>>> ds = xr.Dataset({'foo': ('x', [5, 5, 6, 6])})

0 commit comments

Comments
 (0)