Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5232#discussion_r27534799
  
    --- Diff: python/pyspark/mllib/tests.py ---
    @@ -134,6 +134,14 @@ def test_sparse_vector_indexing(self):
             for ind in [4, -5, 7.8]:
                 self.assertRaises(ValueError, sv.__getitem__, ind)
     
    +    def test_matrix_indexing(self):
    +        mat = DenseMatrix(3, 2, [0, 1, 4, 6, 8, 10])
    +        numcols = mat.numCols
    +        for ind, val in enumerate(mat.values):
    --- End diff --
    
    I think it should be okay to write down the checks explicitly. Or you can 
do this:
    
    ~~~python
    expected = [[0, 6], [1, 8], [4, 10]]
    for i in range(3):
      for j in range(2):
        self.assertEquals(mat[i, j], xpected[i][j])
    ~~~


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to