diff options
author | Dmitriy Sokolov <silentsokolov@gmail.com> | 2016-08-30 11:23:37 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-08-30 11:23:37 +0100 |
commit | d4eee9932edf1a489d7fe9120a0f003150834df6 (patch) | |
tree | 2b05ac9cfaf1e76ca0b44e579d54ec8b3b7494f2 /docs/mllib-data-types.md | |
parent | befab9c1c6b59ad90f63a7d10e12b186be897f15 (diff) | |
download | spark-d4eee9932edf1a489d7fe9120a0f003150834df6.tar.gz spark-d4eee9932edf1a489d7fe9120a0f003150834df6.tar.bz2 spark-d4eee9932edf1a489d7fe9120a0f003150834df6.zip |
[MINOR][DOCS] Fix minor typos in python example code
## What changes were proposed in this pull request?
Fix minor typos python example code in streaming programming guide
## How was this patch tested?
N/A
Author: Dmitriy Sokolov <silentsokolov@gmail.com>
Closes #14805 from silentsokolov/fix-typos.
Diffstat (limited to 'docs/mllib-data-types.md')
-rw-r--r-- | docs/mllib-data-types.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/mllib-data-types.md b/docs/mllib-data-types.md index 7dd3c97a83..35cee3275e 100644 --- a/docs/mllib-data-types.md +++ b/docs/mllib-data-types.md @@ -104,7 +104,7 @@ dv2 = [1.0, 0.0, 3.0] # Create a SparseVector. sv1 = Vectors.sparse(3, [0, 2], [1.0, 3.0]) # Use a single-column SciPy csc_matrix as a sparse vector. -sv2 = sps.csc_matrix((np.array([1.0, 3.0]), np.array([0, 2]), np.array([0, 2])), shape = (3, 1)) +sv2 = sps.csc_matrix((np.array([1.0, 3.0]), np.array([0, 2]), np.array([0, 2])), shape=(3, 1)) {% endhighlight %} </div> @@ -517,12 +517,12 @@ from pyspark.mllib.linalg.distributed import IndexedRow, IndexedRowMatrix # Create an RDD of indexed rows. # - This can be done explicitly with the IndexedRow class: -indexedRows = sc.parallelize([IndexedRow(0, [1, 2, 3]), - IndexedRow(1, [4, 5, 6]), - IndexedRow(2, [7, 8, 9]), +indexedRows = sc.parallelize([IndexedRow(0, [1, 2, 3]), + IndexedRow(1, [4, 5, 6]), + IndexedRow(2, [7, 8, 9]), IndexedRow(3, [10, 11, 12])]) # - or by using (long, vector) tuples: -indexedRows = sc.parallelize([(0, [1, 2, 3]), (1, [4, 5, 6]), +indexedRows = sc.parallelize([(0, [1, 2, 3]), (1, [4, 5, 6]), (2, [7, 8, 9]), (3, [10, 11, 12])]) # Create an IndexedRowMatrix from an RDD of IndexedRows. @@ -731,15 +731,15 @@ from pyspark.mllib.linalg import Matrices from pyspark.mllib.linalg.distributed import BlockMatrix # Create an RDD of sub-matrix blocks. -blocks = sc.parallelize([((0, 0), Matrices.dense(3, 2, [1, 2, 3, 4, 5, 6])), +blocks = sc.parallelize([((0, 0), Matrices.dense(3, 2, [1, 2, 3, 4, 5, 6])), ((1, 0), Matrices.dense(3, 2, [7, 8, 9, 10, 11, 12]))]) # Create a BlockMatrix from an RDD of sub-matrix blocks. mat = BlockMatrix(blocks, 3, 2) # Get its size. -m = mat.numRows() # 6 -n = mat.numCols() # 2 +m = mat.numRows() # 6 +n = mat.numCols() # 2 # Get the blocks as an RDD of sub-matrix blocks. blocksRDD = mat.blocks |