# credit to Sci-Py documentation from scipy.spatial import distance distance.jaccard(x, y) # x, y: array with shape (N, ) # optional argument: weights of x