diff options
author | jason king <pizza@netspace.net.au> | 2015-09-16 23:02:15 +1000 |
---|---|---|
committer | jason king <pizza@netspace.net.au> | 2015-09-16 23:02:15 +1000 |
commit | a3c1ed6dbba1e23bcbe30040bfa3d63e91b2cdab (patch) | |
tree | 0577c96b12003a929e190487e61df4b67e1f2b14 /numpy/lib/function_base.py | |
parent | 772c80b1ce1db7e30497fcf555ac9af56b0d7fce (diff) | |
download | numpy-a3c1ed6dbba1e23bcbe30040bfa3d63e91b2cdab.tar.gz |
DOC: numpy.diff docstring changed as per recommendation on
https://github.com/numpy/numpy/issues/5900
Slight change for cumsame doco as well, to match.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 9 |
1 files changed, 5 insertions, 4 deletions
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 -------- |