scipy.spatial.distance.canberra

scipy.spatial.distance.canberra(u, v)

Computes the Canberra distance between two n-vectors u and v, which is defined as

\frac{\sum_i {|u_i-v_i|}}
     {\sum_i {|u_i|+|v_i|}}.

Parameters :

u : ndarray

An n-dimensional vector.

v : ndarray

An n-dimensional vector.

Returns :

d : double

The Canberra distance between vectors u and v.

Previous topic

scipy.spatial.distance.braycurtis

Next topic

scipy.spatial.distance.chebyshev

This Page