[Scipy-tickets] [SciPy] #1328: scipy.spatial.distance.sqeuclidean broken: Invalid results

SciPy Trac scipy-tickets@scipy....
Sun Jun 12 10:00:40 CDT 2011


#1328: scipy.spatial.distance.sqeuclidean broken: Invalid results
------------------------------------------------------------------------------------+
 Reporter:  stefan_r                                                                |       Owner:  peridot     
     Type:  defect                                                                  |      Status:  needs_review
 Priority:  normal                                                                  |   Milestone:  0.10.0      
Component:  scipy.spatial                                                           |     Version:  0.8.0       
 Keywords:  squared euclidean distance,distance,scipy.spatial.distance.sqeuclidean  |  
------------------------------------------------------------------------------------+

Comment(by rgommers):

 Actually, this will go wrong for many metrics.  This should be fixed for
 all of them at once, with a utility function like:

 {{{
 def _validate_vector(u):
     u = np.asarray(u, order='c').squeeze()
     if u.ndim > 1:
         raise ValueError("Input vector should be 1-D.")
     return u
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1328#comment:8>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list