title: Mapping multiple arrays in scala
body: <p>I have two arrays in Scala both with the same numbers</p>
  
  <pre><code>val v = myGraph.vertices.collect.map(_._1)
  </code></pre>
  
  <p>which gives:</p>
  
  <pre><code>Array[org.apache.spark.graphx.VertexId] = Array(-7023794695707475841, -44591218498176864, 757355101589630892, 21619280952332745)
  </code></pre>
  
  <p>and another</p>
  
  <pre><code>val w = myGraph.vertices.collect.map(_._2._2)
  </code></pre>
  
  <p>which gives:</p>
  
  <pre><code>Array[String] = Array(2, 3, 1, 2)
  </code></pre>
  
  <p>and i want to create a string using </p>
  
  <pre><code>val z =  v.map("{id:" + _ + "," + "group:" + "1" + "}").mkString(",")
  </code></pre>
  
  <p>which gives:</p>
  
  <pre><code>String = {id:-7023794695707475841,group:1},{id:-44591218498176864,group:1},{id:757355101589630892,group:1},{id:21619280952332745,group:1}
  </code></pre>
  
  <p>But now instead of the hardcoded group of "1", i want to instead map in the numbers from the w array to give:</p>
  
  <pre><code>String = {id:-7023794695707475841,group:2},{id:-44591218498176864,group:3},{id:757355101589630892,group:1},{id:21619280952332745,group:2}
  </code></pre>
  
  <p>How do i do this?</p>