This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / lib / _function_base_impl / _ureduce

function

numpy.lib._function_base_impl:_ureduce

source: build-install/usr/lib/python3.14/site-packages/numpy/lib/_function_base_impl.py :3815

Signature

def   _ureduce ( a func keepdims = False ** kwargs )

Summary

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

Extended Summary

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 kwargs.

kwargs : keyword arguments

additional keyword arguments to pass to 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.

Aliases

  • numpy.lib._function_base_impl._ureduce