from operator import itemgetter
transpose = zip(*table)
transpose.sort(key=itemgetter(0))
table = zip(*transpose)
Sorting columns in a table (list of lists) whilst preserving the correspondence of the rows