numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturns
_ureduce(a, func, **kwargs)

Returns result and a.shape with axis dims set to 1.

Parameters

a : array_like

Input array or object that can be converted to an array.

func : callable

Reduction function capable of receiving a single axis argument. It is called with a as first argument followed by :None:None:`kwargs`.

kwargs : keyword arguments

additional keyword arguments to pass to :None:None:`func`.

Returns

result : tuple

Result of func(a, **kwargs) and a.shape with axis dims set to 1 which can be used to reshape the result to the same shape a ufunc with keepdims=True would produce.

Internal Function. Call :None:None:`func` with a as first argument swapping the axes to use extended axis on functions that don't support it natively.

Examples

See :

Local connectivity graph

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


GitHub : /numpy/lib/function_base.py#3651
type: <class 'function'>
Commit: