I have two list of lists, where i want to sort the first with respect to the second. For example here i have the two
old = [[1, 7, 3, 2, 5, 4, 6, 0, 8, 9],
[7, 3, 2, 5, 4, 6, 1, 8, 0, 9],
[9, 2, 8, 7, 1, 5, 0, 4, 6, 3]]
new = [[4, 1, 5, 6, 7, 9, 10, 11, 8, 2, 3, 0],
[10, 6, 4, 3, 0, 11, 2, 5, 8, 1, 9, 7],
[0, 1, 7, 10, 9, 6, 4, 5, 8, 2, 3, 11]]
I want to sort the new list of list w.r.t the old list of list. so for the new one the entries should become
sorted_new = [[1, 7, 3, 2, 5, 4, 6, 0, 8, 9, 10, 11],
[7, 3, 2, 5, 4, 6, 1, 8, 0, 9, 10, 11],
[9, 2, 8, 7, 1, 5, 0, 4, 6, 3, 10, 11]]
important to note is both lists that are to be matched are not of equal size. how can I achieve this?
newwith elements ofoldthat were not in the list yet.