The itertools.combinations produce the following result on 1d array:
array = [1,2,3]
list(itertools.combinations(array, 2))
>>>[(1, 2), (1, 3), (2, 3)]
This is great but what if I want to apply this to every row of a 2d vector?
array = [
[1,2,3],
[1,2,3]
]
list(itertools.combinations(array, 2))
>>>[(array([1, 2, 3]), array([1, 2, 3]))]
The above just combines two sub arrays but what I really want is this:
>>>[
[(1, 2), (1, 3), (2, 3)],
[(1, 2), (1, 3), (2, 3)]
]