bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / spatial / _kdtree / minkowski_distance
function
scipy.spatial._kdtree:minkowski_distance
source: build-install/usr/lib/python3.14/site-packages/scipy/spatial/_kdtree.py:78
Signature
def minkowski_distance(x, y, p = 2.0)Summary
Compute the L**p distance between two arrays.
Extended Summary
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: ndarrayDistance between the input arrays.
Notes
Array API Standard Support
minkowski_distance is not in-scope for support of Python Array API Standard compatible backends other than NumPy.
See dev-arrayapi for more information.
Examples
from scipy.spatial import minkowski_distance
✓minkowski_distance([[0, 0], [0, 0]], [[1, 1], [0, 1]])
✗array([1.414, 1. ])
Aliases
scipy.spatial.minkowski_distance