@@ -602,8 +602,7 @@ def paired_cosine_distances(X, Y):
602602 'l2' : paired_euclidean_distances ,
603603 'l1' : paired_manhattan_distances ,
604604 'manhattan' : paired_manhattan_distances ,
605- 'cityblock' : paired_manhattan_distances ,
606- }
605+ 'cityblock' : paired_manhattan_distances }
607606
608607
609608def paired_distances (X , Y , metric = "euclidean" , ** kwds ):
@@ -1050,8 +1049,8 @@ def pairwise_distances(X, Y=None, metric="euclidean", n_jobs=1, **kwds):
10501049 [n_samples_a, n_features] otherwise
10511050 Array of pairwise distances between samples, or a feature array.
10521051
1053- Y : array [n_samples_b, n_features]
1054- A second feature array only if X has shape [n_samples_a, n_features] .
1052+ Y : array [n_samples_b, n_features], optional
1053+ An optional second feature array. Only allowed if metric != "precomputed" .
10551054
10561055 metric : string, or callable
10571056 The metric to use when calculating distance between instances in a
@@ -1089,7 +1088,7 @@ def pairwise_distances(X, Y=None, metric="euclidean", n_jobs=1, **kwds):
10891088
10901089 """
10911090 if (metric not in _VALID_METRICS and
1092- not callable (metric ) and metric != "precomputed" ):
1091+ not callable (metric ) and metric != "precomputed" ):
10931092 raise ValueError ("Unknown metric %s. "
10941093 "Valid metrics are %s, or 'precomputed', or a "
10951094 "callable" % (metric , _VALID_METRICS ))
0 commit comments