Answers for "argmax python"

1

what is argmax n pyhton

import numpy as np    
A = np.matrix([[1,2,3,33],[4,5,6,66],[7,8,9,99]])

np.argmax(A)  # 11, which is the position of 99

np.argmax(A[:,:])  # 11, which is the position of 99

np.argmax(A[:1])  # 3, which is the position of 33

np.argmax(A[:,2])  # 2, which is the position of 9

np.argmax(A[1:,2])  # 1, which is the position of 9
Posted by: Guest on May-02-2020
0

argmax python

argmax returns index of max value.
Posted by: Guest on June-13-2020

Python Answers by Framework

Browse Popular Code Answers by Language