From a3c1ed6dbba1e23bcbe30040bfa3d63e91b2cdab Mon Sep 17 00:00:00 2001 From: jason king Date: Wed, 16 Sep 2015 23:02:15 +1000 Subject: 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. --- numpy/core/fromnumeric.py | 2 +- numpy/lib/function_base.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'numpy') diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 10626fe9f..d60f9adb2 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -2069,7 +2069,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 -------- -- cgit v1.2.1