How to apply itertools.product to elements of a list of lists? [duplicate]
>>> list(itertools.product(*arrays)) [(-1, -2, -3), (-1, -2, 3), (-1, 2, -3), (-1, 2, 3), (1, -2, -3), (1, -2, 3), (1, 2, -3), (1, 2, 3)] This will feed all the pairs as separate arguments to product, which will then give you the cartesian product of them. The reason your version isn’t working is that … Read more