[Scipy-svn] r5209 - in trunk/scipy: cluster spatial

scipy-svn@scip... scipy-svn@scip...
Sun Nov 30 09:19:26 CST 2008


Author: ptvirtan
Date: 2008-11-30 09:19:11 -0600 (Sun, 30 Nov 2008)
New Revision: 5209

Modified:
   trunk/scipy/cluster/hierarchy.py
   trunk/scipy/spatial/distance.py
Log:
Fix bad latex in docstrings

Modified: trunk/scipy/cluster/hierarchy.py
===================================================================
--- trunk/scipy/cluster/hierarchy.py	2008-11-30 14:48:09 UTC (rev 5208)
+++ trunk/scipy/cluster/hierarchy.py	2008-11-30 15:19:11 UTC (rev 5209)
@@ -506,7 +506,7 @@
 
        .. math::
           d(u,v) = \sum_{ij} \frac{d(u[i], v[j])}
-                                  {(|u|*|v|)
+                                  {(|u|*|v|)}
 
        for all points :math:`i` and :math:`j` where :math:`|u|`
        and :math:`|v|` are the cardinalities of clusters :math:`u`

Modified: trunk/scipy/spatial/distance.py
===================================================================
--- trunk/scipy/spatial/distance.py	2008-11-30 14:48:09 UTC (rev 5208)
+++ trunk/scipy/spatial/distance.py	2008-11-30 15:19:11 UTC (rev 5209)
@@ -449,7 +449,7 @@
     return np.sqrt(((u-v)**2 / V).sum())
 
 def cityblock(u, v):
-    """
+    r"""
     Computes the Manhattan distance between two n-vectors u and v,
     which is defined as
 
@@ -472,7 +472,7 @@
     return abs(u-v).sum()
 
 def mahalanobis(u, v, VI):
-    """
+    r"""
     Computes the Mahalanobis distance between two n-vectors ``u`` and ``v``,
     which is defiend as
 
@@ -498,7 +498,7 @@
     return np.sqrt(np.dot(np.dot((u-v),VI),(u-v).T).sum())
 
 def chebyshev(u, v):
-    """
+    r"""
     Computes the Chebyshev distance between two n-vectors u and v,
     which is defined as
 
@@ -521,7 +521,7 @@
     return max(abs(u-v))
 
 def braycurtis(u, v):
-    """
+    r"""
     Computes the Bray-Curtis distance between two n-vectors ``u`` and
     ``v``, which is defined as
 
@@ -544,7 +544,7 @@
     return abs(u-v).sum() / abs(u+v).sum()
 
 def canberra(u, v):
-    """
+    r"""
     Computes the Canberra distance between two n-vectors u and v,
     which is defined as
 
@@ -607,15 +607,14 @@
     return (nft, ntf)
 
 def yule(u, v):
-    """
+    r"""
     Computes the Yule dissimilarity between two boolean n-vectors u and v,
     which is defined as
 
 
     .. math::
 
-         \frac{R}
-         \frac{c_{TT} + c_{FF} + \frac{R}{2}}
+         \frac{R}{c_{TT} + c_{FF} + \frac{R}{2}}
 
     where :math:`c_{ij}` is the number of occurrences of
     :math:`\mathtt{u[k]} = i` and :math:`\mathtt{v[k]} = j` for
@@ -637,7 +636,7 @@
     return float(2.0 * ntf * nft) / float(ntt * nff + ntf * nft)
 
 def matching(u, v):
-    """
+    r"""
     Computes the Matching dissimilarity between two boolean n-vectors
     u and v, which is defined as
 
@@ -665,7 +664,7 @@
     return float(nft + ntf) / float(len(u))
 
 def dice(u, v):
-    """
+    r"""
     Computes the Dice dissimilarity between two boolean n-vectors
     ``u`` and ``v``, which is
 
@@ -698,7 +697,7 @@
     return float(ntf + nft) / float(2.0 * ntt + ntf + nft)
 
 def rogerstanimoto(u, v):
-    """
+    r"""
     Computes the Rogers-Tanimoto dissimilarity between two boolean
     n-vectors ``u`` and ``v``, which is defined as
 
@@ -727,7 +726,7 @@
     return float(2.0 * (ntf + nft)) / float(ntt + nff + (2.0 * (ntf + nft)))
 
 def russellrao(u, v):
-    """
+    r"""
     Computes the Russell-Rao dissimilarity between two boolean n-vectors
     ``u`` and ``v``, which is defined as
 
@@ -759,7 +758,7 @@
     return float(len(u) - ntt) / float(len(u))
 
 def sokalmichener(u, v):
-    """
+    r"""
     Computes the Sokal-Michener dissimilarity between two boolean vectors
     ``u`` and ``v``, which is defined as
 
@@ -795,7 +794,7 @@
     return float(2.0 * (ntf + nft))/float(ntt + nff + 2.0 * (ntf + nft))
 
 def sokalsneath(u, v):
-    """
+    r"""
     Computes the Sokal-Sneath dissimilarity between two boolean vectors
     ``u`` and ``v``,
 
@@ -829,7 +828,7 @@
 
 
 def pdist(X, metric='euclidean', p=2, V=None, VI=None):
-    """
+    r"""
     Computes the pairwise distances between m original observations in
     n-dimensional space. Returns a condensed distance matrix Y.  For
     each :math:`i` and :math:`j` (where :math:`i<j<n`), the
@@ -1263,7 +1262,7 @@
     return dm
 
 def squareform(X, force="no", checks=True):
-    """
+    r"""
     Converts a vector-form distance vector to a square-form distance
     matrix, and vice-versa.
 
@@ -1456,7 +1455,7 @@
     return valid
 
 def is_valid_y(y, warning=False, throw=False, name=None):
-    """
+    r"""
     Returns ``True`` if the variable ``y`` passed is a valid condensed
     distance matrix. Condensed distance matrices must be 1-dimensional
     numpy arrays containing doubles. Their length must be a binomial
@@ -1558,7 +1557,7 @@
 
 
 def cdist(XA, XB, metric='euclidean', p=2, V=None, VI=None, w=None):
-    """
+    r"""
     Computes distance between each pair of observation vectors in the
     Cartesian product of two collections of vectors. ``XA`` is a
     :math:`m_A` by :math:`n` array while ``XB`` is a :math:`m_B` by
@@ -1782,7 +1781,7 @@
     :Returns:
        Y : ndarray
            A :math:`m_A` by :math:`m_B` distance matrix.
-       """
+    """
 
 
 #         21. Y = cdist(XA, XB, 'test_Y')



More information about the Scipy-svn mailing list