This is not an easy question to ask: I am talking about ordering list A by the order of matching values found in list B.
Most results talk about ordering list A by an ordering field in list B.
After some thinking, it became really obvious how to do this.
Simply create an empty list, find the index of an item in list A of list B.
list_a = [100, 1, 10] list_b = [1, 10, 100] sorted_list_b_by_list_a = sorted(list_a, key=lambda x: list_a.index(x))