Sep-14-2020, 05:50 AM
It seems that you use Numpy arrays. I don't think built-in function will give you what you expect. I would create a list out of the array. Please have a look at the following code.
import numpy as np A = np.array([[1,3],[6,4],[5, 0]]) print(A) print('Sorted is: ') print(np.sort(A)) # lista = [] # for i in range (len(A)): # lista.append(A[i]) # print (lista) # B = sorted(lista, key = lambda e:e[1]) # print(B)