How to find indices of a reordered numpy array?
问题 Say I have a sorted numpy array: arr = np.array([0.0, 0.0], [0.5, 0.0], [1.0, 0.0], [0.0, 0.5], [0.5, 0.5], [1.0, 0.5], [0.0, 1.0], [0.5, 1.0], [1.0, 1.0]) and suppose I make a non trivial operation on it such that I have a new array which is the same as the old one but in another order: arr2 = np.array([0.5, 0.0], [0.0, 0.0], [0.0, 0.5], [1.0, 0.0], [0.5, 0.5], [1.0, 0.5], [0.0, 1.0], [1.0, 1.0], [0.5, 1.0]) The question is: how do you get the indices of where each element of arr2 are placed