`); SciPySciPy Installing User Guide API reference Building from source Development Release notes GitHubGitHub TwitterTwitter Installing User Guide API reference Building from source Development Release notes GitHubGitHub TwitterTwitterSection Navigationscipyscipy.clusterscipy.constantsscipy.datasetsscipy.differentiatescipy.fftscipy.fftpackscipy.integratescipy.interpolatescipy.ioscipy.linalgscipy.ndimagescipy.odrscipy.optimizescipy.signalscipy.sparsescipy.spatialscipy.specialscipy..." />`); SciPySciPy Installing User Guide API reference Building from source Development Release notes GitHubGitHub TwitterTwitter Installing User Guide API reference Building from source Development Release notes GitHubGitHub TwitterTwitterSection Navigationscipyscipy.clusterscipy.constantsscipy.datasetsscipy.differentiatescipy.fftscipy.fftpackscipy.integratescipy.interpolatescipy.ioscipy.linalgscipy.ndimagescipy.odrscipy.optimizescipy.signalscipy.sparsescipy.spatialscipy.specialscipy..." /> num_obs_dm — SciPy v1.15.3 Manual
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