cupyx.scipy.spatial.distance.cityblock#

cupyx.scipy.spatial.distance.cityblock(u, v)[source]#

Compute the City Block (Manhattan) distance between two 1-D arrays.

The City Block distance is defined as

\[d(u, v) = \sum_{i} |u_i - v_i|\]
Parameters:
  • u (array_like) – Input array of size (N,)

  • v (array_like) – Input array of size (N,)

Returns:

The City Block distance between vectors u and v.

Return type:

cityblock (double)