Distance computations (scipy.spatial.distance) — SciPy v1.16.0 Manual (original) (raw)
Function reference#
Distance matrix computation from a collection of raw observation vectors stored in a rectangular array.
Predicates for checking the validity of distance matrices, both condensed and redundant. Also contained in this module are functions for computing the number of observations in a distance matrix.
Distance functions between two numeric vectors u
and v
. Computing distances over a large collection of vectors is inefficient for these functions. Use pdist
for this purpose.
Distance functions between two boolean vectors (representing sets) u
andv
. As in the case of numerical vectors, pdist
is more efficient for computing the distances between all pairs.
hamming also operates over discrete numerical vectors.