apply_over_axes(func, a, axes)
:None:None:`func`
is called as :None:None:`res = func(a, axis)`
, where :None:None:`axis`
is the first element of :None:None:`axes`
. The result :None:None:`res`
of the function call must have either the same dimensions as a
or one less dimension. If :None:None:`res`
has one less dimension than a
, a dimension is inserted before :None:None:`axis`
. The call to :None:None:`func`
is then repeated for each axis in :None:None:`axes`
, with :None:None:`res`
as the first argument.
This function must take two arguments, :None:None:`func(a, axis)`
.
Input array.
Axes over which :None:None:`func`
is applied; the elements must be integers.
The output array. The number of dimensions is the same as a
, but the shape can be different. This depends on whether :None:None:`func`
changes the shape of its output with respect to its input.
Apply a function repeatedly over multiple axes.
apply_along_axis
Apply a function to 1-D slices of an array along the given axis.
>>> a = np.ma.arange(24).reshape(2,3,4)
... a[:,0,1] = np.ma.masked
... a[:,1,:] = np.ma.masked
... a masked_array( data=[[[0, --, 2, 3], [--, --, --, --], [8, 9, 10, 11]], [[12, --, 14, 15], [--, --, --, --], [20, 21, 22, 23]]], mask=[[[False, True, False, False], [ True, True, True, True], [False, False, False, False]], [[False, True, False, False], [ True, True, True, True], [False, False, False, False]]], fill_value=999999)
>>> np.ma.apply_over_axes(np.ma.sum, a, [0,2]) masked_array( data=[[[46], [--], [124]]], mask=[[[False], [ True], [False]]], fill_value=999999)
Tuple axis arguments to ufuncs are equivalent:
>>> np.ma.sum(a, axis=(0,2)).reshape((1,-1,1)) masked_array( data=[[[46], [--], [124]]], mask=[[[False], [ True], [False]]], fill_value=999999)See :
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them