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

    https://github.com/apache/spark/pull/685#discussion_r12502533
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala 
---
    @@ -171,8 +192,11 @@ class SparseVector(
         val indices: Array[Int],
         val values: Array[Double]) extends Vector {
     
    +  require(indices.length == values.length)
    +
       override def toString: String = {
    -    "(" + size + "," + indices.zip(values).mkString("[", "," ,"]") + ")"
    +    Seq(size, indices.mkString("[", ",", "]"), values.mkString("[", ",", 
"]"))
    +      .mkString("(", ",", ")")
    --- End diff --
    
    Small nit, it would probably be easier to write
    ```
    "(%s,%s,%s)".format(size, indices.mkString("[", ",", "]"), 
values.mkString("[", ",", "]"))
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to