Skip to content

Instantly share code, notes, and snippets.

View jacarrico's full-sized avatar

João André Carriço jacarrico

View GitHub Profile
@jacarrico
jacarrico / comparing_partitions.py
Created May 4, 2017 13:53 — forked from peterk87/comparing_partitions.py
Python: Calculate Adjusted Wallace, Wallace and Rand coefficients, and Simpson's index of diversity
import sys
import math
def getContTable(ar1, ar2):
cont = {}
for i in xrange(0, len(ar1)):
keyAr1 = ar1[i]
keyAr2 = ar2[i]
if keyAr1 in cont: