Itertools Combination Memory Error With Python
I have a Memory error when I use combinations with a big list of list like len 735. Any way to do a similar process but without the error? from itertools import combinations valor
Solution 1:
If your list has 735 elements, then there are (735 choose 3) = 65907695 combinations of three elements. There is probably no need to keep all of these 3-tuples in memory at the same time, so don't build a list out of them; just iterate directly.
for c in combinations(valores, 3):
# do something with c
Post a Comment for "Itertools Combination Memory Error With Python"