In [8]:
import itertools
import pickle
from math import factorial
In [2]:
labels = pickle.load(open("labels.pickle"
))
In [3]:
len(labels)
Out[3]:
In [7]:
list(itertools.combinations(labels, 2))
Out[7]:
In [9]:
def num_combinations(n,r=2):
return factorial(n)/(factorial(r)*factorial(n-r))
In [10]:
num_combinations(5
)
Out[10]:
In [22]:
for i in range(5,1000,5):
print "%s: %s" % (i, num_combinations(i))
In [18]:
l = range(0, 190)
In [19]:
len(l)
Out[19]:
In [21]:
len(list(itertools.combinations(l,2)))
Out[21]:
In [ ]: