def jacardCoefficient(a, b):
    """Return the Jacard coefficient of a and b.

    The jacard coefficient is defined as the overlap between two sets: the sum
    of all equal elements divided by the size of the sets.

    Mind that a and b must b in Hamming space, so every element must either be
    1 or 0.
    """
    if a.shape != b.shape:
        raise ValueError("Arrays must be of same shape")

    length = a.shape[0]
    a = a.astype(bool)
    b = b.astype(bool)

    return length / float((a == b).sum())
dataset/ETHPy150Open pybrain/pybrain/pybrain/supervised/knn/lsh/minhash.py/jacardCoefficient/swapped operands of `/`