0

I've got the following array of arrays:

array([[ 0.04497471, -3.        ],
       [ 0.0449076 , -2.        ],
       [ 0.0448405 , -1.        ],
       [ 0.04463641,  1.        ],
       [ 0.0445693 ,  2.        ],
       [ 0.04450219,  3.        ]])

(this example is already sorted)

I want to sort it so the first column is ordered in descending order, while maintaining the figure in the second column with its partner.

I've tried using np.sort(a, axis=0), but it treats the columns separately. How do I get it to maintain the rows?

cjm2671
  • 18,348
  • 31
  • 102
  • 161

0 Answers0