frlearn.utils.np_utils.least

frlearn.utils.np_utils.least(a, k, axis=-1)[source]

Returns the k least values of a along the specified axis, in order. If k is in (0, 1), it is interpreted as a fraction of the total number, with a minimum of 1. If k is None, all values of a will be returned.

Parameters
andarray

Input array of values.

kint or float or None

Number of values to return. If a float in (0, 1), taken as a fraction of the total number of values. If None, all values are returned.

axisint, default=-1

The axis along which values are selected.

Returns
least_along_axisndarray

An array with the same shape as a, with the specified axis reduced according to the value of k.