def sokalsneath(u, v):
 u = _validate_vector(u)
 v = _validate_vector(v)
 if (u.dtype == bool):
  ntt = (u & v).sum()
 else:
  ntt = (u * v).sum()
 (nft, ntf) = _nbool_correspond_ft_tf(u, v)
 denom = (ntt + (2.0 * (ntf + nft)))
 if (denom == 0):
  raise ValueError('Sokal-Sneath dissimilarity is not defined for vectors that are entirely false.')
 return (float((2.0 * (ntf + nft))) / denom)

def sokalsneath ( u , v ) : u = _validate_vector ( u ) v = _validate_vector ( v ) if ( u . dtype == bool ) : ntt = ( u & v ) . sum ( ) else : ntt = ( u * v ) . sum ( ) ( nft , ntf ) = _nbool_correspond_ft_tf ( u , v ) denom = ( ntt + ( 2.0 * ( ntf + nft ) ) ) if ( denom == 0 ) : raise ValueError ( 'Sokal-Sneath dissimilarity is not defined for vectors that are entirely false.' ) return ( float ( ( 2.0 * ( ntf + nft ) ) ) / denom )
computes the sokal-sneath dissimilarity between two boolean 1-d arrays .