Let's say I have two lists, l1 and l2:
l1 = [1,9,6,8,3]
l2 = [8,1]
The list l2 will be sorted according to the ordering of list l1, so in this case:
l2_reordered = [1,8]
Note: List l2 will always have 2 items which have a different value.
I can think of a naive loop approach to doing this, but that is going to be really inefficient. What is a pythonic and efficient way of doing this?