I'm trying to do some combinatorial stuff with data in Python. I looked the question How to generate all permutations of a list in Python, but think that doesn't fit my needs.. I have data of this type...:
group1-Steve
group1-Mark
group1-Tom
group2-Brett
group2-Mick
group2-Foo
group3-Dan
group3-Phil
...and i need to make all possible combinations of three elements with only one from each group, without repetitions, saving to a list every combination.
I know in this case there are 18 possible different combinations(3*3*2=18), but don't know how could i write this code. I ve read about the Pyncomb package, but don't know the function to apply in this case; maybe there's a function which does the job.
Hope anyone could help me...
Thanks in advance;
Peixe