bundles / scipy latest / scipy / spatial / _kdtree / minkowski_distance_p
function
scipy.spatial._kdtree:minkowski_distance_p
source: /scipy/spatial/_kdtree.py :11
Signature
def minkowski_distance_p ( x , y , p = 2.0 ) Summary
Compute the pth power of the L**p distance between two arrays.
Extended Summary
For efficiency, this function computes the L**p distance but does not extract the pth root. If p is 1 or infinity, this is equal to the actual L**p distance.
The last dimensions of x and y must be the same length. Any other dimensions must be compatible for broadcasting.
Parameters
x: (..., K) array_likeInput array.
y: (..., K) array_likeInput array.
p: float, 1 <= p <= infinityWhich Minkowski p-norm to use.
Returns
dist: ndarraypth power of the distance between the input arrays.
Examples
from scipy.spatial import minkowski_distance_p minkowski_distance_p([[0, 0], [0, 0]], [[1, 1], [0, 1]])✓
Aliases
-
scipy.spatial.minkowski_distance_p