diff options
author | Alex Rothberg <agrothberg@gmail.com> | 2017-02-12 14:38:06 -0500 |
---|---|---|
committer | Alex Rothberg <agrothberg@gmail.com> | 2017-02-12 19:55:00 -0500 |
commit | 0b7215793d0702746f78d5b43e9d3a357de82de6 (patch) | |
tree | 86bde5644971281f99179a9b7048e7be9cc0e1ae /numpy/lib | |
parent | 6f5b96929928b298dc7038659ca74e2c335e8b75 (diff) | |
download | python-numpy-0b7215793d0702746f78d5b43e9d3a357de82de6.tar.gz python-numpy-0b7215793d0702746f78d5b43e9d3a357de82de6.tar.bz2 python-numpy-0b7215793d0702746f78d5b43e9d3a357de82de6.zip |
DOC: Indicate that axis param to average may be a tuple of ints.
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/function_base.py | 13 |
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. |