{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "See "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "squareform"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for information on how to calculate the index of this entry or to convert the condensed distance matrix to a redundant square matrix."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The following are common calling conventions."
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": true,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'euclidean')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the distance between m points using Euclidean distance    (2-norm) as the distance metric between the points. The points    are arranged as m n-dimensional row vectors in the matrix X."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'minkowski', p=2.)"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the distances using the Minkowski distance    "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "\\|u-v\\|_p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " ("
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "-norm) where "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "p > 0"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (note    that this is only a quasi-metric if "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "0 < p < 1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ")."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'cityblock')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the city block or Manhattan distance between the    points."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'seuclidean', V=None)"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the standardized Euclidean distance. The standardized    Euclidean distance between two n-vectors "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "u"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "v"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is"
                    }
                  ]
                },
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "\\sqrt{\\sum {(u_i-v_i)^2 / V[x_i]}}"
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "V is the variance vector; V[i] is the variance computed over all    the i'th components of the points.  If not passed, it is    automatically computed."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'sqeuclidean')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the squared Euclidean distance "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "\\|u-v\\|_2^2"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " between    the vectors."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'cosine')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the cosine distance between vectors u and v,"
                    }
                  ]
                },
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "1 - \\frac{u \\cdot v}\n            {{\\|u\\|}_2 {\\|v\\|}_2}"
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "where "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "\\|*\\|_2"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the 2-norm of its argument "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "*"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", and    "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "u \\cdot v"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the dot product of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "u"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "v"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'correlation')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the correlation distance between vectors u and v. This is"
                    }
                  ]
                },
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "1 - \\frac{(u - \\bar{u}) \\cdot (v - \\bar{v})}\n            {{\\|(u - \\bar{u})\\|}_2 {\\|(v - \\bar{v})\\|}_2}"
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "where "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "\\bar{v}"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the mean of the elements of vector v,    and "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "x \\cdot y"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the dot product of "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "y"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'hamming')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the normalized Hamming distance, or the proportion of    those vector elements between two n-vectors "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "u"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "v"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "    which disagree. To save memory, the matrix "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "X"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " can be of type    boolean."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'jaccard')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Jaccard distance between the points. Given two    vectors, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "u"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "v"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", the Jaccard distance is the    proportion of those elements "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "u[i]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "v[i]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " that    disagree."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'jensenshannon')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Jensen-Shannon distance between two probability arrays.     Given two probability vectors, "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "q"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", the     Jensen-Shannon distance is"
                    }
                  ]
                },
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "\\sqrt{\\frac{D(p \\parallel m) + D(q \\parallel m)}{2}}"
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "where "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "m"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the pointwise mean of "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "p"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "q"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "     and "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "D"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the Kullback-Leibler divergence."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'chebyshev')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Chebyshev distance between the points. The     Chebyshev distance between two n-vectors "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "u"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "v"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the     maximum norm-1 distance between their respective elements. More     precisely, the distance is given by"
                    }
                  ]
                },
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "d(u,v) = \\max_i {|u_i-v_i|}"
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'canberra')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Canberra distance between the points. The     Canberra distance between two points "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "u"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "v"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is"
                    }
                  ]
                },
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "d(u,v) = \\sum_i \\frac{|u_i-v_i|}\n                         {|u_i|+|v_i|}"
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'braycurtis')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Bray-Curtis distance between the points. The     Bray-Curtis distance between two points "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "u"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "v"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is"
                    }
                  ]
                },
                {
                  "__type": "Math",
                  "__tag": 4058,
                  "value": "d(u,v) = \\frac{\\sum_i {|u_i-v_i|}}\n                   {\\sum_i {|u_i+v_i|}}"
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'mahalanobis', VI=None)"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Mahalanobis distance between the points. The     Mahalanobis distance between two points "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "u"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "v"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is     "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "\\sqrt{(u-v)(1/V)(u-v)^T}"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " where "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "(1/V)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (the "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "VI"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "     variable) is the inverse covariance. If "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "VI"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is not None,     "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "VI"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " will be used as the inverse covariance matrix."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'yule')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Yule distance between each pair of boolean     vectors. (see yule function documentation)"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'matching')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Synonym for 'hamming'."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'dice')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Dice distance between each pair of boolean     vectors. (see dice function documentation)"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'rogerstanimoto')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Rogers-Tanimoto distance between each pair of     boolean vectors. (see rogerstanimoto function documentation)"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'russellrao')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Russell-Rao distance between each pair of     boolean vectors. (see russellrao function documentation)"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, 'sokalsneath')"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the Sokal-Sneath distance between each pair of     boolean vectors. (see sokalsneath function documentation)"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Y = pdist(X, f)"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Computes the distance between all pairs of vectors in X     using the user supplied 2-arity function f. For example,     Euclidean distance between the vectors could be computed     as follows        "
                    }
                  ]
                },
                {
                  "__type": "Code",
                  "__tag": 4050,
                  "value": "dm = pdist(X, lambda u, v: np.sqrt(((u-v)**2).sum()))",
                  "execution_status": null
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Note that you should avoid passing a reference to one of     the distance functions defined in this library. For example,        "
                    }
                  ]
                },
                {
                  "__type": "Code",
                  "__tag": 4050,
                  "value": "dm = pdist(X, sokalsneath)",
                  "execution_status": null
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "would calculate the pair-wise distances between the vectors in     X using the Python function sokalsneath. This would result in     sokalsneath being called "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "{n \\choose 2}"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " times, which     is inefficient. Instead, the optimized C version is more     efficient, and we call it using the following syntax.        "
                    }
                  ]
                },
                {
                  "__type": "Code",
                  "__tag": 4050,
                  "value": "dm = pdist(X, 'sokalsneath')",
                  "execution_status": null
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "Y",
              "annotation": "ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Returns a condensed distance matrix Y. For each "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "i"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "j"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (where "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "i<j<m"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "),where m is the number of original observations. The metric "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "dist(u=X[i], v=X[j])"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is computed and stored in entry "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "m * i + j - ((i + 2) * (i + 1)) // 2"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Pairwise distances between observations in n-dimensional space."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "X",
              "annotation": "array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An m by n array of m original observations in an n-dimensional space."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "metric",
              "annotation": "str or function, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The distance metric to use. The distance function can be 'braycurtis', 'canberra', 'chebyshev', 'cityblock', 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jaccard', 'jensenshannon', 'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalsneath', 'sqeuclidean', 'yule'."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "out",
              "annotation": "ndarray, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The output array. If not None, condensed distance matrix Y is stored in this array."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "**kwargs",
              "annotation": "dict, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Extra arguments to "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "metric"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ": refer to each metric documentation for a list of all possible arguments."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Some possible arguments:"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "pscalar The p-norm to apply for Minkowski, weighted and unweighted. Default: 2."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "wndarray The weight vector for metrics that support weights (e.g., Minkowski)."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Vndarray The variance vector for standardized Euclidean. Default: var(X, axis=0, ddof=1)"
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "VIndarray The inverse of the covariance matrix for Mahalanobis. Default: inv(cov(X.T)).T"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "See Notes for common calling conventions."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/spatial/distance.py",
  "item_line": 1816,
  "item_type": "function",
  "aliases": [
    "scipy.interpolate._rbf.pdist"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nfrom scipy.spatial.distance import pdist\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n``x`` is an array of five points in three-dimensional space.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "x = np.array([[2, 0, 2], [2, 2, 3], [-2, 4, 5], [0, 1, 9], [2, 2, 4]])\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n``pdist(x)`` with no additional arguments computes the 10 pairwise\nEuclidean distances:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "pdist(x)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe following computes the pairwise Minkowski distances with ``p = 3.5``:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "pdist(x, metric='minkowski', p=3.5)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe pairwise city block or Manhattan distances:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "pdist(x, metric='cityblock')\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "squareform",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.spatial.distance:squareform"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "converts between condensed distance matrices and square distance matrices."
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "X",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "metric",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "euclidean"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "out",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "kwargs",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "VAR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "pdist"
  },
  "references": null,
  "qa": "scipy.spatial.distance:pdist",
  "arbitrary": [],
  "local_refs": [
    "**kwargs",
    "X",
    "Y",
    "metric",
    "out"
  ]
}