Categories
October Surprise 2024

Sort array’s rows by another array in Python – Stack Overflow

I’m trying to sort the rows of one array by the values of another. For example: … I want to sort arr1 in descending order, and to have the current relationship between arr1 and arr2 to be maintained (ie, after sorting both, the rows of arr1 [0] and arr2 [0, :] are the same).