parameters: (u, v, w=None)
return_statement: return float((ntf + nft) / np.array(2.0 * ntt + ntf + nft))
docstring: Compute the Dice dissimilarity between two boolean 1-D arrays.
  
      The Dice dissimilarity between `u` and `v`, is
  
      .. math::
  
           \\frac{c_{TF} + c_{FT}}
                {2c_{TT} + c_{FT} + c_{TF}}
  
      where :math:`c_{ij}` is the number of occurrences of
      :math:`\\mathtt{u[k]} = i` and :math:`\\mathtt{v[k]} = j` for
      :math:`k < n`.
  
      Parameters
      ----------
      u : (N,) ndarray, bool
          Input 1-D array.
      v : (N,) ndarray, bool
          Input 1-D array.
      w : (N,) array_like, optional
          The weights for each value in `u` and `v`. Default is None,
          which gives each value a weight of 1.0
  
      Returns
      -------
      dice : double
          The Dice dissimilarity between 1-D arrays `u` and `v`.
  
      Examples
      --------
      >>> from scipy.spatial import distance
      >>> distance.dice([1, 0, 0], [0, 1, 0])
      1.0
      >>> distance.dice([1, 0, 0], [1, 1, 0])
      0.3333333333333333
      >>> distance.dice([1, 0, 0], [2, 0, 0])
      -0.3333333333333333
docstring_summary: Compute the Dice dissimilarity between two boolean 1-D arrays.
docstring_tokens: Compute the Dice dissimilarity between two boolean 1 - D arrays .
function: def dice(u, v, w=None):
      """
      Compute the Dice dissimilarity between two boolean 1-D arrays.
  
      The Dice dissimilarity between `u` and `v`, is
  
      .. math::
  
           \\frac{c_{TF} + c_{FT}}
                {2c_{TT} + c_{FT} + c_{TF}}
  
      where :math:`c_{ij}` is the number of occurrences of
      :math:`\\mathtt{u[k]} = i` and :math:`\\mathtt{v[k]} = j` for
      :math:`k < n`.
  
      Parameters
      ----------
      u : (N,) ndarray, bool
          Input 1-D array.
      v : (N,) ndarray, bool
          Input 1-D array.
      w : (N,) array_like, optional
          The weights for each value in `u` and `v`. Default is None,
          which gives each value a weight of 1.0
  
      Returns
      -------
      dice : double
          The Dice dissimilarity between 1-D arrays `u` and `v`.
  
      Examples
      --------
      >>> from scipy.spatial import distance
      >>> distance.dice([1, 0, 0], [0, 1, 0])
      1.0
      >>> distance.dice([1, 0, 0], [1, 1, 0])
      0.3333333333333333
      >>> distance.dice([1, 0, 0], [2, 0, 0])
      -0.3333333333333333
  
      """
      u = _validate_vector(u)
      v = _validate_vector(v)
      if w is not None:
          w = _validate_weights(w)
      if u.dtype == v.dtype == bool and w is None:
          ntt = (u & v).sum()
      else:
          dtype = np.find_common_type([int], [u.dtype, v.dtype])
          u = u.astype(dtype)
          v = v.astype(dtype)
          if w is None:
              ntt = (u * v).sum()
          else:
              ntt = (u * v * w).sum()
      (nft, ntf) = _nbool_correspond_ft_tf(u, v, w=w)
      return float((ntf + nft) / np.array(2.0 * ntt + ntf + nft))
function_tokens: def dice ( u , v , w = None ) : u = _validate_vector ( u ) v = _validate_vector ( v ) if w is not None : w = _validate_weights ( w ) if u . dtype == v . dtype == bool and w is None : ntt = ( u & v ) . sum ( ) else : dtype = np . find_common_type ( [ int ] , [ u . dtype , v . dtype ] ) u = u . astype ( dtype ) v = v . astype ( dtype ) if w is None : ntt = ( u * v ) . sum ( ) else : ntt = ( u * v * w ) . sum ( ) ( nft , ntf ) = _nbool_correspond_ft_tf ( u , v , w = w ) return float ( ( ntf + nft ) / np . array ( 2.0 * ntt + ntf + nft ) )