One more thing which can be considered is the other interpretation as pointed out by darkless
Code in Python 2.7
Mainly:
- Reorder by value - Already solved by AJ above
Reorder by index
mylist = ['a', 'b', 'c', 'd', 'e']
myorder = [3, 2, 0, 1, 4]
mylist = sorted(zip(mylist, myorder), key=lambda x: x[1])
print [item[0] for item in mylist]
This will print ['c', 'd', 'b', 'a', 'e']