<p dir="auto">Apparently, the axis argument of <code class="notranslate">np.average</code> can be a tuple:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [20]: np.average([[1.,2],[3,4]],axis=(0,1))
Out[20]: 2.5"><pre class="notranslate"><code class="notranslate">In [20]: np.average([[1.,2],[3,4]],axis=(0,1))
Out[20]: 2.5
</code></pre></div>
<p dir="auto">but this case is not documented:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [21]: np.average?
Signature: np.average(a, axis=None, weights=None, returned=False)
Docstring:
Compute the weighted average along the specified axis.

Parameters
----------
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.
.."><pre class="notranslate"><code class="notranslate">In [21]: np.average?
Signature: np.average(a, axis=None, weights=None, returned=False)
Docstring:
Compute the weighted average along the specified axis.

Parameters
----------
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.
..
</code></pre></div>
<p dir="auto">Docs for<code class="notranslate">average</code> indicate that axis may be an int but does not indicate that it may be a tuple. the tuple format <em>does</em> work</p>
<p dir="auto">Docs: <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.average.html" rel="nofollow">https://docs.scipy.org/doc/numpy/reference/generated/numpy.average.html</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; np.average(np.ones((4,4,4)), axis=(1,2))
array([ 1.,  1.,  1.,  1.])"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; np.average(np.ones((4,4,4)), axis=(1,2))
array([ 1.,  1.,  1.,  1.])
</code></pre></div>