Let say I have the matrix
import numpy as np
A = np.matrix([[1,2,3,33],[4,5,6,66],[7,8,9,99]])
I am trying to understand the function a
argmax
is a function which gives the index of the greatest number in the given row or column and the row or column can be decided using axis attribute of argmax
funcion. If we give axis=0
then it will give the index from columns and if we give axis=1
then it will give the index from rows.
In your given example A[1:, 2]
it will first fetch the values from 1st row on wards and the only 2nd column value from those rows, then it will find the index of max value from into the resulted matrix.