I have a list with the length of n:
labels = ['a', 'b', 'c', 'd']
and a array with the size of m*n like:
values = array([[0. , 0.6, 0.3, 0.1],
[0.5, 0.1, 0.1, 0.3],
[0.1, 0.2, 0.3, 0.4]])
I wish to sort labels by each line of values and to generate a new m*n array like:
labels_new = [['a', 'd', 'c', 'b'],
['b', 'c', 'd', 'a'],
['a', 'b', 'c', 'd']]
Is there any simple way to achieve this?