I have an array of variable numbers. I have another array that I want to be the of labels for the numbers array.
myList = [T1_sum, T2_sum, T3_sum, T4_sum, T5_sum, T6_sum, T7_sum, T8_sum, T9_sum, T10_sum]
mylables = ["cats", "dogs", "monkey", "fish", "rabbit", "owl", "pig", "goat", "cow", "bull"]
I want to sort the array by highest to lowest value. I did this by:
sortedlist = sorted(myList, reverse=True)
However, how do I rearrange the labels so that they are in line with the values?
I need to keep it so that a sortedlabellist
is its own individual array (for future things). so i will probably have to link the values to the labels and then pull out a sortedlabellist
separately?