I have a list of strings like this:
X = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\"]
Y = [ 0, 1, 1, 0, 1, 2, 2, 0, 1 ]
Also, if you don't mind using numpy arrays (or in fact already are dealing with numpy arrays...), here is another nice solution:
people = ['Jim', 'Pam', 'Micheal', 'Dwight']
ages = [27, 25, 4, 9]
import numpy
people = numpy.array(people)
ages = numpy.array(ages)
inds = ages.argsort()
sortedPeople = people[inds]
I found it here: http://scienceoss.com/sort-one-list-by-another-list/