def mahalanobis(u, v, VI):
 u = _validate_vector(u)
 v = _validate_vector(v)
 VI = np.atleast_2d(VI)
 delta = (u - v)
 m = np.dot(np.dot(delta, VI), delta)
 return np.sqrt(m)

def mahalanobis ( u , v , VI ) : u = _validate_vector ( u ) v = _validate_vector ( v ) VI = np . atleast_2d ( VI ) delta = ( u - v ) m = np . dot ( np . dot ( delta , VI ) , delta ) return np . sqrt ( m )
computes the mahalanobis distance between two 1-d arrays .