I need to use the itertools.product() in Python, but the given parameters cannot be fixed, cause previously I'm loading an empty array with subarrays, using a procedure that doesn't always load the same number of subarrays.
So, let's put an example. Let's suppose that I have a variable called arraysVar. This procedure could load several subarrays as I said, for example:
[[True,False],['a','b']]
Or:
[[True,False],['a','b'],['weak','medium','strong']]
Or whatever.. It just has several arrays inside with different values inside them.
Then I want to do the product of all them with itertools, but I only know to pass a fixed number of parameters by saying:
itertools.product(arraysVar[0],arraysVar[1], ...)
But since the number of subarrays is variable, I want to pass as many parameters as subarrays inside arraysVar. How could I do it?
I tried this:
itertools.product([arraysVar[i] for i in range(len(arraysVar))])
But it doesn't work properly cause it considers it's getting only 1 parameter.
Thanks in advance.