I have the following lists:
Factor1 = [1,2,3,4]
Factor2 = [5,6,7,8]
Factor3 = [9,10,11,12]
And the combination of the names of the lists:
Combination = [['Factor1','Factor2'], ['Factor3','Factor1']]
I would like to refer to the list Combination
to combine the elements of the Factor*
lists by zipping the list and the result as follows:
Combination1 = [(1,5),(2,6),(3,7),(4,8)]
Combination2 = [(9,1),(10,2),(11,3),(12,4)]
Note that I have simplified the problem because my Combination
list has more than 1000 combinations while the current example has only 2. Hence, I wanted to iterate the process above.
The idea is to code as below:
Combination1 = list (zip(Factor1,Factor2))
But the problem is I am not sure how do you use the elements of the Combination
list to as an input to the zip
portion of the code.