'How i can find a specific row and look for the minimum element index in a numpy array

I got a numpy array from a csv file. It is 6 X 6. I want to find a specific row and then find the lower element index.



Solution 1:[1]

This creates a random array 6x6, since you did not provide any data and finds the index of the minimum in the row_n specific row.

import numpy as np

a = np.random.rand(6, 6)
print(a)

row_n = 0
print(a[row_n, :].argmin())

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ljmc