I have 3 python lists of the same dimensions, a
, b
and c
and I want to reorder
them all based on the values in b
. First create some toy data:
Now we zip the 3 lists together and sort by the first element, in our example this
will be b
:
Finally we can unpack the sorted, zipped lists using a few list comprehensions to
get the data back sorted but in its original shape: