For a 2d array, a, we can sort using
a = a[a[:, 0].argsort]
if we want to sort by column 0. How to do a similar thing for a 3d matrix? If we have
a = [[[ 1., 2., 10.],
[ 4., 5., 6.],
[ 2., 3., 4.]],
[[ 2., 3., 4.],
[ 4., 5., 6.],
[ 1., 2., 3.]],
[[ 1., 2., 3.],
[ 4., 5., 6.],
[ 2., 3., 4.]]]
And we want to sort according to the first column of each element of the 3d matrix?
a = a[a[:,:,0].argsort()]??[1,2,3] > [1,3,5], what you can do is compare the first element of each column, the l1 or l2 norms, max value, etc.