Loading [MathJax]/jax/output/HTML-CSS/jax.js
SciPy

This is documentation for an old release of SciPy (version 0.17.0). Read this page in the documentation of the latest stable release (version 1.15.1).

scipy.spatial.distance.minkowski

scipy.spatial.distance.minkowski(u, v, p)[source]

Computes the Minkowski distance between two 1-D arrays.

The Minkowski distance between 1-D arrays u and v, is defined as

||uv||p=(|uivi|p)1/p.
Parameters:

u : (N,) array_like

Input array.

v : (N,) array_like

Input array.

p : int

The order of the norm of the difference ||uv||p.

Returns:

d : double

The Minkowski distance between vectors u and v.