美文网首页
【Python】np.argmax()

【Python】np.argmax()

作者: 盐果儿 | 来源:发表于2023-05-07 03:18 被阅读0次

np.argmax(A, axis=1) is a NumPy function that returns an array of indices of the maximum values along the second axis (axis=1) of a given NumPy array A.

import numpy as np

A = np.array([[1, 3, 2], [4, 2, 1], [3, 5, 6]])

print(np.argmax(A, axis=1))

# output: [1 0 2]

相关文章

网友评论

      本文标题:【Python】np.argmax()

      本文链接:https://www.haomeiwen.com/subject/qsdhsdtx.html