I have got the following sort function:
orderedX = np.array(list(to_sort.values()))\
[np.array(list(to_sort.values())).argmax(axis=1).argsort(), :]
but I want to change it such that, orderedX becomes a dictionary with the items of to_sort, instead of just a list of its values. So the way it is sorted is correct, but is there someway I can also keep track of the keys while doing this?
to_sort is a dict with keys and values, where each value is a np.array