<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Currently, all the metrics in <span style="font-family: "Courier New", monospace;">
scipy.spatial.distance</span><span style="font-family: Calibri, Helvetica, sans-serif;"> call
<span class="blob-code-inner blob-code-marker rgh-observing-whitespace" data-code-marker=" ">
<span data-rgh-whitespace="space"></span><span class="pl-en">_validate_vector which internally does</span></span></span><code><span style="font-family: "Courier New", monospace;"><br>
</span></code></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<code><span style="font-family: "Courier New", monospace;"><br>
</span></code></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<code><span style="font-family: "Courier New", monospace;">input = np.atleast_1d(</span></code><span style="font-family: "Courier New", monospace;">input.squeeze())</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;"></span>This means the input can have any number of extra length-1 dimensions which are ignored and not propagated to the output. Shapes that shouldn't be compatible (e.g. (1, 3) and (3, 1) array) also match
up as if they were 1d, instead of broadcasting like normal NumPy operations. <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In order to extend the distance metrics with n-dimensional array support, we either break broadcasting or remove this behavior.
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
So, in <a href="https://github.com/scipy/scipy/pull/13774" id="LPlnk">PR #13774</a> I'm proposing to deprecate the squeeze and require the input actually be 1-dimensional.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
-Peter<br>
</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div>
<br>
</body>
</html>