1 致謝
感謝網友粗麪魚丸提供的資料,
原文鏈接:https://www.cnblogs.com/subic/p/8710946.html
2 numpy中索引的學習筆記
1.1 如果獲得np矩陣的最大值的索引
可以參考下面的示例代碼:
import numpy as np
matrix = np.array([[1, 2, 3],
[4, 5, 6]])
index = np.unravel_index(matrix.argmax(), matrix.shape)
print(index)
>>>(1, 2)