min_pos#

sklearn.utils.arrayfuncs.min_pos(X)#

Find the minimum value of an array over positive values.

Returns the maximum representable value of the input dtype if none of thevalues are positive.

Parameters:
Xndarray of shape (n,)

Input array.

Returns:
min_valfloat
The smallest positive value in the array, or the maximum representable value

of the input dtype if no positive values are found.

Examples

>>>importnumpyasnp>>>fromsklearn.utils.arrayfuncsimportmin_pos>>>X=np.array([0,-1,2,3,-4,5])>>>min_pos(X)2.0
On this page

This Page