2 numpy arrays have the exact same values.
arr1 = np.array([1,2,3,4,5])
arr2 = np.array([2,3,1,5,4])
How can I order the values in the first array the way they are ordered in the second array?
2 numpy arrays have the exact same values.
arr1 = np.array([1,2,3,4,5])
arr2 = np.array([2,3,1,5,4])
How can I order the values in the first array the way they are ordered in the second array?
Try using the np.vectorize method from here
map_dict = {x[0]:x[1] for x in zip(arr1, arr2)}
mapped_array = np.vectorize(map_dict.get)(arr1)