SciPy

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

scipy.spatial.distance.chebyshev

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

Computes the Chebyshev distance.

Computes the Chebyshev distance between two 1-D arrays u and v, which is defined as

\[\max_i {|u_i-v_i|}.\]
Parameters:

u : (N,) array_like

Input vector.

v : (N,) array_like

Input vector.

Returns:

chebyshev : double

The Chebyshev distance between vectors u and v.