In [8]:
import itertools
import pickle
from math import factorial

In [2]:
labels = pickle.load(open("labels.pickle"
                         ))

In [3]:
len(labels)


Out[3]:
5

In [7]:
list(itertools.combinations(labels, 2))


Out[7]:
[('Assemblage-1', 'Assemblage-2'),
 ('Assemblage-1', 'Assemblage-3'),
 ('Assemblage-1', 'Assemblage-4'),
 ('Assemblage-1', 'Assemblage-5'),
 ('Assemblage-2', 'Assemblage-3'),
 ('Assemblage-2', 'Assemblage-4'),
 ('Assemblage-2', 'Assemblage-5'),
 ('Assemblage-3', 'Assemblage-4'),
 ('Assemblage-3', 'Assemblage-5'),
 ('Assemblage-4', 'Assemblage-5')]

In [9]:
def num_combinations(n,r=2):
    return factorial(n)/(factorial(r)*factorial(n-r))

In [10]:
num_combinations(5
                )


Out[10]:
10

In [22]:
for i in range(5,1000,5):
    print "%s: %s" % (i, num_combinations(i))


5: 10
10: 45
15: 105
20: 190
25: 300
30: 435
35: 595
40: 780
45: 990
50: 1225
55: 1485
60: 1770
65: 2080
70: 2415
75: 2775
80: 3160
85: 3570
90: 4005
95: 4465
100: 4950
105: 5460
110: 5995
115: 6555
120: 7140
125: 7750
130: 8385
135: 9045
140: 9730
145: 10440
150: 11175
155: 11935
160: 12720
165: 13530
170: 14365
175: 15225
180: 16110
185: 17020
190: 17955
195: 18915
200: 19900
205: 20910
210: 21945
215: 23005
220: 24090
225: 25200
230: 26335
235: 27495
240: 28680
245: 29890
250: 31125
255: 32385
260: 33670
265: 34980
270: 36315
275: 37675
280: 39060
285: 40470
290: 41905
295: 43365
300: 44850
305: 46360
310: 47895
315: 49455
320: 51040
325: 52650
330: 54285
335: 55945
340: 57630
345: 59340
350: 61075
355: 62835
360: 64620
365: 66430
370: 68265
375: 70125
380: 72010
385: 73920
390: 75855
395: 77815
400: 79800
405: 81810
410: 83845
415: 85905
420: 87990
425: 90100
430: 92235
435: 94395
440: 96580
445: 98790
450: 101025
455: 103285
460: 105570
465: 107880
470: 110215
475: 112575
480: 114960
485: 117370
490: 119805
495: 122265
500: 124750
505: 127260
510: 129795
515: 132355
520: 134940
525: 137550
530: 140185
535: 142845
540: 145530
545: 148240
550: 150975
555: 153735
560: 156520
565: 159330
570: 162165
575: 165025
580: 167910
585: 170820
590: 173755
595: 176715
600: 179700
605: 182710
610: 185745
615: 188805
620: 191890
625: 195000
630: 198135
635: 201295
640: 204480
645: 207690
650: 210925
655: 214185
660: 217470
665: 220780
670: 224115
675: 227475
680: 230860
685: 234270
690: 237705
695: 241165
700: 244650
705: 248160
710: 251695
715: 255255
720: 258840
725: 262450
730: 266085
735: 269745
740: 273430
745: 277140
750: 280875
755: 284635
760: 288420
765: 292230
770: 296065
775: 299925
780: 303810
785: 307720
790: 311655
795: 315615
800: 319600
805: 323610
810: 327645
815: 331705
820: 335790
825: 339900
830: 344035
835: 348195
840: 352380
845: 356590
850: 360825
855: 365085
860: 369370
865: 373680
870: 378015
875: 382375
880: 386760
885: 391170
890: 395605
895: 400065
900: 404550
905: 409060
910: 413595
915: 418155
920: 422740
925: 427350
930: 431985
935: 436645
940: 441330
945: 446040
950: 450775
955: 455535
960: 460320
965: 465130
970: 469965
975: 474825
980: 479710
985: 484620
990: 489555
995: 494515

In [18]:
l = range(0, 190)

In [19]:
len(l)


Out[19]:
190

In [21]:
len(list(itertools.combinations(l,2)))


Out[21]:
17955

In [ ]: