{ } Raw JSON

bundles / scipy latest / scipy / spatial / distance / chebyshev

function

scipy.spatial.distance:chebyshev

source: /scipy/spatial/distance.py :1041

Signature

def   chebyshev ( u v w = None )

Summary

Compute the Chebyshev distance.

Extended Summary

The Chebyshev distance between real vectors and is defined as [1]

If a (non-negative) weight vector is supplied, the weighted Chebyshev distance is defined to be the weighted Minkowski distance of infinite order; that is,

Parameters

u : (N,) array_like of floats

Input vector.

v : (N,) array_like of floats

Input vector.

w : (N,) array_like of floats, optional

Weight vector. Default is None, which gives all pairs the same weight 1.0.

Returns

chebyshev : float

The Chebyshev distance between vectors u and v, optionally weighted by w.

Examples

from scipy.spatial import distance
distance.chebyshev([1, 0, 0], [0, 1, 0])
distance.chebyshev([1, 1, 0], [0, 1, 0])

Aliases

  • scipy.spatial.distance.chebyshev