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:
- arr
numpy.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).
- n
int 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.
- arr
- Returns:
- nth_min_values
numpy.ndarray A 1D numpy array of shape (i,) containing the n-th minimum value from each row.
- nth_min_values
- Raises:
- ValueError
If n is less than 1 or greater than the number of columns in the array.