Tipp zum Python-zip-Modul

Steht auch schon so in der Python Dokumentation zum Sortieren, dass die funktionale Variante die weniger performante (da Kopie nötig) ist, jedoch ist die Bevorzugte

Python short hand for sorting a transversed list

a = [[1,2,4,3], [5,6,7,8]]  [[1,2,3,4], [5,6,8,7]]
a = zip(*a)
a.sort()  # np.sort(a, axis=0) sorts first each row
a = zip(*a)
or more easy/functional, but less performant: a = zip(*sorted(zip(*a)))

links

social