Skip to content

Commit 6dce2df

Browse files
committed
address comments
1 parent 116b5db commit 6dce2df

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

python/pyspark/mllib/linalg.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def dot(self, other):
305305
results = [self.dot(other[:, i]) for i in xrange(other.shape[1])]
306306
return np.array(results)
307307
elif other.ndim > 2:
308-
raise ValueError("Cannot call dot with %d-dimentaional array" % other.ndim)
308+
raise ValueError("Cannot call dot with %d-dimensional array" % other.ndim)
309309

310310
assert len(self) == _vector_size(other), "dimension mismatch"
311311

@@ -534,8 +534,7 @@ def toArray(self):
534534
array([[ 0., 2.],
535535
[ 1., 3.]])
536536
"""
537-
return np.ndarray((self.numRows, self.numCols), np.float64,
538-
order='F', buffer=self.values.tostring())
537+
return np.reshape(self.values, (self.numRows, self.numCols), order='F')
539538

540539

541540
def _test():

0 commit comments

Comments
 (0)