def simpson_so(x):
    """
    Simpson diversity index SO
    ...

    Arguments
    ---------
    x       : array
              N x k array containing N rows (one per neighborhood) and k columns
              (one per cultural group)
    Returns
    -------
    a       : float
              Simpson diversity index SO
    """
    xs0 = x.sum(axis=0)
    xs = x.sum()
    num = (xs0 * (xs0 - 1.0)).sum()
    den = xs * (xs - 1.0)
    return num / den
