I have a numpy array
array([[ 4.14022471, 3.96360618],
[ 0.37601032, 1.25528411],
[ 3.49313049, 0.94909878]])
Now I wish to sort this array's rows with respect to the norm of the rows, i.e
norm([ 4.14022471, 3.96360618]) = 5.73163455
norm([ 0.37601032, 1.25528411]) = 1.31039
norm([ 3.49313049, 0.94909878]) = 3.61977197
Hence the first row remains in first position, while 2nd and 3rd rows need to be swapped.
The solution will be
array([[ 4.14022471, 3.96360618],
[ 3.49313049, 0.94909878],
[ 0.37601032, 1.25528411]])
How can I do this?