def dice(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)
 return (float((ntf + nft)) / float((((2.0 * ntt) + ntf) + nft)))

def dice ( 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 ) return ( float ( ( ntf + nft ) ) / float ( ( ( ( 2.0 * ntt ) + ntf ) + nft ) ) )
computes the dice dissimilarity between two boolean 1-d arrays .