Skip to main content

Module distance

Module distance 

Source
Expand description

Distances between observations, following scipy.spatial.distance: the standard metrics, the condensed pairwise distances of one set (pdist), the distances between two sets (cdist), and conversion between condensed and square forms (squareform).

See the book entry More descriptive statistics and robust regression.

Enums§

Metric
A distance between two vectors u and v.

Functions§

cdist
The ma × mb matrix of distances between two sets of observations (SciPy’s cdist).
distance
The distance between u and v under metric (SciPy’s functions in spatial.distance).
pdist
The condensed distance matrix of m observations (SciPy’s pdist): the m(m − 1)/2 distances d(i, j) for i < j, in row order.
squareform
Expands a condensed distance vector into the symmetric square matrix with a zero diagonal (SciPy’s squareform). Its length must be m(m − 1)/2 for some m.
squareform_to_condensed
The condensed form of a square distance matrix (SciPy’s squareform in the other direction): its entries above the diagonal, in row order. The matrix must be square and symmetric with a zero diagonal.