Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note on diff's n differing from pandas #3822

Merged
merged 2 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -2692,6 +2692,12 @@ def diff(self, dim: Hashable, n: int = 1, label: Hashable = "upper") -> "DataArr
difference : same type as caller
The n-th order finite difference of this object.

.. note::

`n` matches numpy's behavior and is different from pandas' similarly
dcherian marked this conversation as resolved.
Show resolved Hide resolved
located `periods` argument


Examples
--------
>>> arr = xr.DataArray([5, 5, 6, 6], [[1, 2, 3, 4]], ['x'])
Expand Down
5 changes: 5 additions & 0 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4879,6 +4879,11 @@ def diff(self, dim, n=1, label="upper"):
difference : same type as caller
The n-th order finite difference of this object.

.. note::

`n` matches numpy's behavior and is different from pandas' similarly
located `periods` argument

Examples
--------
>>> ds = xr.Dataset({'foo': ('x', [5, 5, 6, 6])})
Expand Down