{ } Raw JSON

bundles / numpy 2.4.4 / numpy / lib / _arraypad_impl / _get_stats

function

numpy.lib._arraypad_impl:_get_stats

source: /numpy/lib/_arraypad_impl.py :231

Signature

def   _get_stats ( padded axis width_pair length_pair stat_func )

Summary

Calculate statistic for the empty-padded array in given dimension.

Parameters

padded : ndarray

Empty-padded array.

axis : int

Dimension in which the statistic is calculated.

width_pair : (int, int)

Pair of widths that mark the pad area on both sides in the given dimension.

length_pair : 2-element sequence of None or int

Gives the number of values in valid area from each side that is taken into account when calculating the statistic. If None the entire valid area in padded is considered.

stat_func : function

Function to compute statistic. The expected signature is stat_func(x: ndarray, axis: int, keepdims: bool) -> ndarray.

Returns

left_stat, right_stat : ndarray

Calculated statistic for both sides of padded.

Aliases

  • numpy.lib._arraypad_impl._get_stats