summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2017-02-14 09:24:44 -0700
committerGitHub <noreply@github.com>2017-02-14 09:24:44 -0700
commitbbd5a7750fbed42a4aaf12f196282a9504a1e865 (patch)
treebcb312690a69aaeb3c96d0272fb761a5abf7d7cf /numpy/lib/function_base.py
parentee40ff69127fee94e7e3103445729024e7b3de21 (diff)
parent0b7215793d0702746f78d5b43e9d3a357de82de6 (diff)
downloadnumpy-bbd5a7750fbed42a4aaf12f196282a9504a1e865.tar.gz
Merge pull request #8611 from cancan101/average_axes_docs
DOC: The axis argument of average can be a tuple of ints
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 51353351f..2aa104174 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -1027,9 +1027,16 @@ def average(a, axis=None, weights=None, returned=False):
a : array_like
Array containing data to be averaged. If `a` is not an array, a
conversion is attempted.
- axis : int, optional
- Axis along which to average `a`. If `None`, averaging is done over
- the flattened array.
+ axis : None or int or tuple of ints, optional
+ Axis or axes along which to average `a`. The default,
+ axis=None, will average over all of the elements of the input array.
+ If axis is negative it counts from the last to the first axis.
+
+ .. versionadded:: 1.7.0
+
+ If axis is a tuple of ints, averaging is performed on all of the axes
+ specified in the tuple instead of a single axis or all the axes as
+ before.
weights : array_like, optional
An array of weights associated with the values in `a`. Each value in
`a` contributes to the average according to its associated weight.