You cannot use an iterator for counts elements. The number of elements is hidden before you iterate them.
In addition, the preferred approach in terms of efficiency is to first count each of the elements and then find the pairs. This saves you a lot of time because the pair share is in total multiplying the number of times each of the elements appears.
You can try something like that:
from collections import Counter
import itertools
MyList = [1,1,1,2,3,4,4] # you can insert here your df.series as list
a = dict(Counter(MyList))
combinations = itertools.combinations(list(a.keys()),2)
for i in combinations:
print (i,a[i[0]]*a[i[1]])
The output is:
(1, 2) 3
(1, 3) 3
(1, 4) 6
(2, 3) 1
(2, 4) 2
(3, 4) 2
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…