{ } Raw JSON

bundles / scipy 1.17.1 / scipy / spatial / distance / sokalsneath

function

scipy.spatial.distance:sokalsneath

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

Signature

def   sokalsneath ( u v w = None )

Summary

Compute the Sokal-Sneath dissimilarity between two boolean 1-D arrays.

Extended Summary

The Sokal-Sneath dissimilarity between u and v,

where is the number of occurrences of and for and .

Parameters

u : (N,) array_like, bool

Input array.

v : (N,) array_like, bool

Input array.

w : (N,) array_like, optional

The weights for each value in u and v. Default is None, which gives each value a weight of 1.0

Returns

sokalsneath : double

The Sokal-Sneath dissimilarity between vectors u and v.

Examples

from scipy.spatial import distance
distance.sokalsneath([1, 0, 0], [0, 1, 0])
distance.sokalsneath([1, 0, 0], [1, 1, 0])
distance.sokalsneath([1, 0, 0], [2, 1, 0])
distance.sokalsneath([1, 0, 0], [3, 1, 0])

Aliases

  • scipy.spatial.distance.sokalsneath