def overlap_dist(a, b, d):
    """ 
    calculates the hamming (overlap) distance between observations for data 
    containing only nominal / categorical features, returns float value
    """
    dist = [None] * d
    for i in range(d):
        if a.iloc[i] == b.iloc[i]:
            dist[i] = 0
        else:
            dist[i] = 1
    dist = sum(dist)
    return dist
