diff options
Diffstat (limited to 'numpy/lib/shape_base.py')
-rw-r--r-- | numpy/lib/shape_base.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py index c299c1976..38b928d57 100644 --- a/numpy/lib/shape_base.py +++ b/numpy/lib/shape_base.py @@ -153,6 +153,12 @@ def apply_over_axes(func, a, axes): apply_along_axis : Apply a function to 1-D slices of an array along the given axis. + Notes + ------ + This function is equivalent to tuple axis arguments to reorderable ufuncs + with keepdims=True. Tuple axis arguments to ufuncs have been availabe since + version 1.7.0. + Examples -------- >>> a = np.arange(24).reshape(2,3,4) @@ -172,6 +178,13 @@ def apply_over_axes(func, a, axes): [ 92], [124]]]) + Tuple axis arguments to ufuncs are equivalent: + + >>> np.sum(a, axis=(0,2), keepdims=True) + array([[[ 60], + [ 92], + [124]]]) + """ val = asarray(a) N = a.ndim |