numpy sort array by another array
order = arr1.argsort() sorted_arr1 = arr1[order] sorted_arr2 = arr2[order]
Source: stackoverflow.com
order = arr1.argsort() sorted_arr1 = arr1[order] sorted_arr2 = arr2[order]