I have a numpy array like this:
A = array([[1, 3, 2, 7], [2, 4, 1, 3], [6, 1, 2, 3]])
I would like to sort the rows of th
Just multiply your matrix by -1 to reverse order:
[In]: A = np.array([[1, 3, 2, 7], [2, 4, 1, 3], [6, 1, 2, 3]]) [In]: print( np.argsort(-A) ) [Out]: [[3 1 2 0] [1 3 0 2] [0 3 2 1]]