This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / spatial / distance / _distance / chebyshev

function

scipy.spatial.distance._distance:chebyshev

source: build-install/usr/lib/python3.14/site-packages/scipy/spatial/distance/_distance.py:971

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])
✗
np.int64(1)

Aliases

  • scipy.spatial.distance.chebyshev