This is documentation for an old release of SciPy (version 0.12.0). Read this page in the documentation of the latest stable release (version 1.15.1).
Compute the distance matrix.
Returns the matrix of all pair-wise distances.
Parameters : | x : (M, K) array_like
y : (N, K) array_like
p : float, 1 <= p <= infinity
threshold : positive int
|
---|---|
Returns : | result : (M, N) ndarray
|
Examples
>>> distance_matrix([[0,0],[0,1]], [[1,0],[1,1]])
array([[ 1. , 1.41421356],
[ 1.41421356, 1. ]])