I currently have a small script written which takes four lists, where, for instance, every 0'th index matches each other. I sort these lists by the first list, while the other lists are sorted in the same pattern. Like so:
Unsorted lists:
list0: 4, 2, 1, 3
list1: four, two, one, three
Sorted lists:
list0: 1, 2, 3, 4
list1: one, two, three, four
This works with the following script:
list0=IN[0]
list1=IN[1]
list2=IN[2]
list3=IN[3]
list0,list1,list2,list3 =zip(*sorted(zip(list0,list1,list2,list3)))
list0,list1,list2,list3 = (list(t) for t in zip(*sorted(zip(list0,list1,list2,list3))))
#Output:
OUT = [list0,list1,list2,list3]
I want to be able to convert this to a more general script with any number of lists. Thus, my input would be a list of lists, and they should be sorted like shown in the code above. Can you help me out?
Best regards,
Ask