I\'m trying to write some code to test out the Cartesian product of a bunch of input parameters.
I\'ve looked at itertools, but its product
By the way, this is not a permutation. A permutation is a rearrangement of a list. This is an enumeration of possible selections from lists.
Edit: after remembering that it was called a Cartesian product, I came up with this:
import itertools
options = {"number": [1,2,3], "color": ["orange","blue"] }
product = [x for x in apply(itertools.product, options.values())]
print [dict(zip(options.keys(), p)) for p in product]