summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/fromnumeric.py2
-rw-r--r--numpy/lib/function_base.py9
2 files changed, 6 insertions, 5 deletions
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
--------