Skip to content
Snippets Groups Projects
Commit c4e0fde8 authored by Shuai Lin's avatar Shuai Lin Committed by Andrew Or
Browse files

[MINOR][DOC] Fixed some python snippets in mllib data types documentation.

## What changes were proposed in this pull request?

Some python snippets is using scala imports and comments.

## How was this patch tested?

Generated the docs locally with `SKIP_API=1 jekyll build` and viewed the changes in the browser.

Author: Shuai Lin <linshuai2012@gmail.com>

Closes #12869 from lins05/fix-mllib-python-snippets.
parent dbacd999
No related branches found
No related tags found
No related merge requests found
......@@ -314,12 +314,12 @@ matrices. Remember, local matrices in MLlib are stored in column-major order.
Refer to the [`Matrix` Python docs](api/python/pyspark.mllib.html#pyspark.mllib.linalg.Matrix) and [`Matrices` Python docs](api/python/pyspark.mllib.html#pyspark.mllib.linalg.Matrices) for more details on the API.
{% highlight python %}
import org.apache.spark.mllib.linalg.{Matrix, Matrices}
from pyspark.mllib.linalg import Matrix, Matrices
// Create a dense matrix ((1.0, 2.0), (3.0, 4.0), (5.0, 6.0))
# Create a dense matrix ((1.0, 2.0), (3.0, 4.0), (5.0, 6.0))
dm2 = Matrices.dense(3, 2, [1, 2, 3, 4, 5, 6])
// Create a sparse matrix ((9.0, 0.0), (0.0, 8.0), (0.0, 6.0))
# Create a sparse matrix ((9.0, 0.0), (0.0, 8.0), (0.0, 6.0))
sm = Matrices.sparse(3, 2, [0, 1, 3], [0, 2, 1], [9, 6, 8])
{% endhighlight %}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment