Skip to content

Commit 28746cb

Browse files
committed
Clarify metric parameter in linkage docstring
* Make clear that the metric parameter is only used in the case that linkages has been passed a collection of observation vectors and is ignored otherwise. * Change "the customized distance function" (which wrongly implies there is a specific function) to "a custom distance function"
1 parent db2ab40 commit 28746cb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scipy/cluster/hierarchy.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,11 @@ def linkage(y, method='single', metric='euclidean'):
605605
The linkage algorithm to use. See the ``Linkage Methods`` section below
606606
for full descriptions.
607607
metric : str or function, optional
608-
The distance metric to use. See the ``distance.pdist`` function for a
609-
list of valid distance metrics. The customized distance can also be
610-
used. See the ``distance.pdist`` function for details.
608+
The distance metric to use in the case that y is a collection of
609+
observation vectors; ignored otherwise. See the ``distance.pdist``
610+
function for a list of valid distance metrics. A custom distance
611+
function can also be used. See the ``distance.pdist`` function for
612+
details.
611613
612614
Returns
613615
-------

0 commit comments

Comments
 (0)