本文簡要介紹 python 語言中 numpy.matrix.argmax
的用法。
用法:
matrix.argmax(axis=None, out=None)
沿軸的最大值的索引。
返回沿指定軸第一次出現最大值的索引。如果軸為無,則索引用於展平矩陣。
- See `numpy.argmax` for complete descriptions:
參數:
注意:
這與
ndarray.argmax
相同,但返回一個matrix
對象,其中ndarray.argmax
將返回一個ndarray
。例子:
>>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.argmax() 11 >>> x.argmax(0) matrix([[2, 2, 2, 2]]) >>> x.argmax(1) matrix([[3], [3], [3]])
相關用法
- Python numpy matrix.argmin用法及代碼示例
- Python numpy matrix.astype用法及代碼示例
- Python numpy matrix.all用法及代碼示例
- Python numpy matrix.A1用法及代碼示例
- Python numpy matrix.T用法及代碼示例
- Python numpy matrix.I用法及代碼示例
- Python numpy matrix.partition用法及代碼示例
- Python numpy matrix.transpose用法及代碼示例
- Python numpy matrix.itemsize用法及代碼示例
- Python numpy matrix.newbyteorder用法及代碼示例
- Python numpy matrix.sort用法及代碼示例
- Python numpy matrix.std用法及代碼示例
- Python numpy matrix.tolist用法及代碼示例
- Python numpy matrix.strides用法及代碼示例
- Python numpy matrix.squeeze用法及代碼示例
- Python numpy matrix.getA1用法及代碼示例
- Python numpy matrix.tostring用法及代碼示例
- Python numpy matrix.setfield用法及代碼示例
- Python numpy matrix.resize用法及代碼示例
- Python numpy matrix.size用法及代碼示例
- Python numpy matrix.getfield用法及代碼示例
- Python numpy matrix.A用法及代碼示例
- Python numpy matrix.flat用法及代碼示例
- Python numpy matrix.ctypes用法及代碼示例
- Python numpy matrix.sum用法及代碼示例
注:本文由純淨天空篩選整理自numpy.org大神的英文原創作品 numpy.matrix.argmax。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。