Permute rows in "slices" of 3d array to match each other Permute rows in "slices" of 3d array to match each other numpy numpy

Permute rows in "slices" of 3d array to match each other


Sorry I should have looked at your code sample; that was very informative.

Seems like this here gives an out-of-the-box solution to your problem:

http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.linear_sum_assignment.html#scipy.optimize.linear_sum_assignment

Only really feasible for a few 100 points at most though, in my experience.