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 ]
zip, sort by the second column, return the first column.
zip(*sorted(zip(X,Y), key=operator.itemgetter(1)))[0]