diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-10-01 14:23:27 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-10-01 14:23:27 -0600 |
commit | 91e16f63474b43cd586e1a61e50285032f39a256 (patch) | |
tree | c06b69ccbee84bcb26a9f0016192a86e6c1e19f2 /numpy | |
parent | 2bc213bb3a75069775bc2a6cbc43dc26e1664835 (diff) | |
parent | a3c1ed6dbba1e23bcbe30040bfa3d63e91b2cdab (diff) | |
download | numpy-91e16f63474b43cd586e1a61e50285032f39a256.tar.gz |
Merge pull request #6322 from pizzathief/issue5900
DOC: numpy.diff docstring changed as per recommendation on
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/fromnumeric.py | 2 | ||||
-rw-r--r-- | numpy/lib/function_base.py | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 10f4a98c5..7ba364512 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -2073,7 +2073,7 @@ def cumsum(a, axis=None, dtype=None, out=None): trapz : Integration of array values using the composite trapezoidal rule. - diff : Calculate the n-th order discrete difference along given axis. + diff : Calculate the n-th discrete difference along given axis. Notes ----- diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 007ff42a4..3c941ca5b 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -1316,10 +1316,10 @@ def gradient(f, *varargs, **kwargs): def diff(a, n=1, axis=-1): """ - Calculate the n-th order discrete difference along given axis. + Calculate the n-th discrete difference along given axis. - The first order difference is given by ``out[n] = a[n+1] - a[n]`` along - the given axis, higher order differences are calculated by using `diff` + The first difference is given by ``out[n] = a[n+1] - a[n]`` along + the given axis, higher differences are calculated by using `diff` recursively. Parameters @@ -1334,8 +1334,9 @@ def diff(a, n=1, axis=-1): Returns ------- diff : ndarray - The `n` order differences. The shape of the output is the same as `a` + The n-th differences. The shape of the output is the same as `a` except along `axis` where the dimension is smaller by `n`. +. See Also -------- |