I have tried to convert my array to a 2-D array and utilizing np.sort
and np.lexsort
but have not had any luck.
import numpy as np
# Here are the 2 arrays I would like to sort b using a.
a = np.array([6,5,3,4,1,2])
b = np.array(["x","y","z","a","b","c"])
Is it possible to sort b using a?
When printing b the output should be:
["b", "c", "z", "a", "y", "x"]