diff --git a/python/pyspark/mllib/linalg.py b/python/pyspark/mllib/linalg.py index 23d1a79ffe511..7702beb127144 100644 --- a/python/pyspark/mllib/linalg.py +++ b/python/pyspark/mllib/linalg.py @@ -502,7 +502,7 @@ def dot(self, other): 25.0 >>> a.dot(array.array('d', [1., 2., 3., 4.])) 22.0 - >>> b = SparseVector(4, [2, 4], [1.0, 2.0]) + >>> b = SparseVector(4, [2], [1.0]) >>> a.dot(b) 0.0 >>> a.dot(np.array([[1, 1], [2, 2], [3, 3], [4, 4]])) @@ -567,11 +567,11 @@ def squared_distance(self, other): 11.0 >>> a.squared_distance(np.array([1., 2., 3., 4.])) 11.0 - >>> b = SparseVector(4, [2, 4], [1.0, 2.0]) + >>> b = SparseVector(4, [2], [1.0]) >>> a.squared_distance(b) - 30.0 + 26.0 >>> b.squared_distance(a) - 30.0 + 26.0 >>> b.squared_distance([1., 2.]) Traceback (most recent call last): ...