def wminkowski(u, v, p, w):
 u = _validate_vector(u)
 v = _validate_vector(v)
 w = _validate_vector(w)
 if (p < 1):
  raise ValueError('p must be at least 1')
 dist = norm((w * (u - v)), ord=p)
 return dist

def wminkowski ( u , v , p , w ) : u = _validate_vector ( u ) v = _validate_vector ( v ) w = _validate_vector ( w ) if ( p < 1 ) : raise ValueError ( 'p must be at least 1' ) dist = norm ( ( w * ( u - v ) ) , ord = p ) return dist
computes the weighted minkowski distance between two 1-d arrays .