scipy.spatial.distance.

num_obs_dm#

scipy.spatial.distance.num_obs_dm(d)[source]#

Return the number of original observations that correspond to a square, redundant distance matrix.

Parameters:
darray_like

The target distance matrix.

Returns:
num_obs_dmint

The number of observations in the redundant distance matrix.

Examples

Find the number of original observations corresponding to a square redundant distance matrix d.

>>> from scipy.spatial.distance import num_obs_dm
>>> d = [[0, 100, 200], [100, 0, 150], [200, 150, 0]]
>>> num_obs_dm(d)
3