scipy.spatial.distance.wminkowski

scipy.spatial.distance.wminkowski(*args, **kwds)[source]

Computes the Weighted Minkowski distance between two 1-D arrays.

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

\[ \begin{align}\begin{aligned}{||u-v||}_p = (\sum{|u_i - v_i|^p})^{1/p}.\\\left(\sum{(|w_i (u_i - v_i)|^p)}\right)^{1/p}.\end{aligned}\end{align} \]
Parameters:

u : (N,) array_like

Input array.

v : (N,) array_like

Input array.

p : int

The order of the norm of the difference \({||u-v||}_p\).

w : (N,) array_like, optional

The weights for each value in u and v. Default is None, which gives each value a weight of 1.0

Returns:

minkowski : double

The Weighted Minkowski distance between vectors u and v.

Notes

wminkowski is DEPRECATED. It is simply an alias of minkowski in scipy >= 1.0.