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

    https://github.com/apache/spark/pull/17968#discussion_r143702830
  
    --- Diff: python/pyspark/ml/linalg/__init__.py ---
    @@ -976,14 +976,18 @@ def __getitem__(self, indices):
                 return self.values[i + j * self.numRows]
     
         def __eq__(self, other):
    +
    +        if isinstance(other, SparseMatrix):
    +            return np.all(self.toArray() == other.toArray())
             if (not isinstance(other, DenseMatrix) or
    --- End diff --
    
    The condition not `isinstance(other, DenseMatrix)` is useless. remove it.


---

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

Reply via email to