You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2019/07/01 02:40:55 UTC
[spark] branch branch-2.4 updated: [SPARK-28170][ML][PYTHON]
Uniform Vectors and Matrix documentation
This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-2.4 by this push:
new d57b392 [SPARK-28170][ML][PYTHON] Uniform Vectors and Matrix documentation
d57b392 is described below
commit d57b392961167bb8dfd888d79efa947277d62ec9
Author: Marco Gaido <ma...@gmail.com>
AuthorDate: Mon Jul 1 11:40:12 2019 +0900
[SPARK-28170][ML][PYTHON] Uniform Vectors and Matrix documentation
## What changes were proposed in this pull request?
The documentation in `linalg.py` is not consistent. This PR uniforms the documentation.
## How was this patch tested?
NA
Closes #25011 from mgaido91/SPARK-28170.
Authored-by: Marco Gaido <ma...@gmail.com>
Signed-off-by: HyukjinKwon <gu...@apache.org>
(cherry picked from commit 048224ce9a3bdb304ba24852ecc66c7f14c25c11)
Signed-off-by: HyukjinKwon <gu...@apache.org>
---
python/pyspark/ml/linalg/__init__.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/python/pyspark/ml/linalg/__init__.py b/python/pyspark/ml/linalg/__init__.py
index 9da9836..9261d65 100644
--- a/python/pyspark/ml/linalg/__init__.py
+++ b/python/pyspark/ml/linalg/__init__.py
@@ -386,14 +386,14 @@ class DenseVector(Vector):
def toArray(self):
"""
- Returns an numpy.ndarray
+ Returns the underlying numpy.ndarray
"""
return self.array
@property
def values(self):
"""
- Returns a list of values
+ Returns the underlying numpy.ndarray
"""
return self.array
@@ -681,7 +681,7 @@ class SparseVector(Vector):
def toArray(self):
"""
- Returns a copy of this SparseVector as a 1-dimensional NumPy array.
+ Returns a copy of this SparseVector as a 1-dimensional numpy.ndarray.
"""
arr = np.zeros((self.size,), dtype=np.float64)
arr[self.indices] = self.values
@@ -862,7 +862,7 @@ class Matrix(object):
def toArray(self):
"""
- Returns its elements in a NumPy ndarray.
+ Returns its elements in a numpy.ndarray.
"""
raise NotImplementedError
@@ -937,7 +937,7 @@ class DenseMatrix(Matrix):
def toArray(self):
"""
- Return an numpy.ndarray
+ Return a numpy.ndarray
>>> m = DenseMatrix(2, 2, range(4))
>>> m.toArray()
@@ -1121,7 +1121,7 @@ class SparseMatrix(Matrix):
def toArray(self):
"""
- Return an numpy.ndarray
+ Return a numpy.ndarray
"""
A = np.zeros((self.numRows, self.numCols), dtype=np.float64, order='F')
for k in xrange(self.colPtrs.size - 1):
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org