sort() and argsort() (NumPy)

np.sort() returns a sorted copy of an array, and np.argsort() returns the indices that would sort it. Sorting works along an axis, and argsort is the key to…