medpy.neighbours.knn.pdist#

medpy.neighbours.knn.pdist(objects, dmeasure, diagval=inf)[source]#

Compute the pair-wise distances between arbitrary objects.

Parameters:
objectssequence

A sequence of objects of length n.

dmeasurefunction

A callable function that takes two objects as input at returns a number.

diagvalnumber

The diagonal values of the resulting array.

Returns:
pdistsndarray

An nxn symmetric float array containing the pair-wise distances.

Notes

dmeasure is assumed to be symmetry i.e. between object a and object b the function will be called only ones.