Categories
Development

Pair elements from lists of list to form a new list

I have a list of lists like the following, a = [[ [1,2], [10, 3]], [[4,5], [6, 7]]] I need to pair the inner most list elements this way, a = [[[1, 10], [2, 3]], [[4, 6], [5, 7]]]. The straighforward approach would be the following, pairings_ = [] for ind in a: pairings_.append([[x, y] […]