pynetdesign.modelling.utils.nth_minimum#

pynetdesign.modelling.utils.nth_minimum(arr, n)[source]#

Find the n-th minimum value in each row of a given 2D numpy array.

Parameters:
arrnumpy.ndarray

A 2D numpy array of shape (i, j) where i is the number of rows (features) and j is the number of columns (samples).

nint

The order of the minimum value to find (1-based index). For example, if n=2, the function finds the 2nd minimum value in each row.

Returns:
nth_min_valuesnumpy.ndarray

A 1D numpy array of shape (i,) containing the n-th minimum value from each row.

Raises:
ValueError

If n is less than 1 or greater than the number of columns in the array.