I have a list of sets, and I wish to sample n different samples each containing an item from each set. What I do not want is to have it in order, so for example I will get all the samples necessarily with the same item from the first set. I also don't want to create all the Cartesian products as that might not be possible in terms of efficiency... Any idea of how to do it? or even something to approximate this behaviour?
example that does not work:
(prod for i, prod in zip(range(n), itertools.product(*list_of_sets)))
Aucun commentaire:
Enregistrer un commentaire