Должны отображать элементы в соответствии с их строками и столбцами.
import numpy as np
b = np.arange(9.).reshape(3, 3)
print(b)
b5 = np.where( b >5)
c=b[b5]
print("***Values of where the elements are, and their rows/columns***")
for row,col in enumerate(b):
for j in c:
if col in c:
print("Value:",j,"in row",row,", column",col)
[[0. 1. 2.]
[3. 4. 5.]
[6. 7. 8.]]
***Values of where the elements are, and their rows/columns***
Value: 6.0 in row 2 , column [6. 7. 8.]
Value: 7.0 in row 2 , column [6. 7. 8.]
Value: 8.0 in row 2 , column [6. 7. 8.]
Ожидается, что будет показан номер столбца.
то есть. Значение: 6,0 в строке 2, столбец 0