title: Scala 2.12.10 with Spark 3.0.0 : What does "data.map(Tuple1.apply)" do?
body: <p>I'm following an example for PCA analysis in Spark 3.0.0, using Scala 2.12.10. I'm having trouble understanding some of the nuances of Scala and I'm quite new to programming in Scala.</p>
  <p>After defining the data as such:</p>
  <pre><code>val data = Array(
              Vectors.sparse(5, Seq((1, 1.0), (3, 7.0))),
              Vectors.dense(2.0, 0.0, 3.0, 4.0, 5.0),
              Vectors.dense(4.0, 0.0, 0.0, 6.0, 7.0)
          )
  </code></pre>
  <p>the dataframe is created as such:</p>
  <pre><code>val df = spark.createDataFrame(data.map(Tuple1.apply)).toDF(&quot;features&quot;)
  </code></pre>
  <p>My question is: what does <code>data.map(Tuple1.apply)</code> do? I guess what bugs me is the fact apply doesn't have arguments.</p>
  <p>Thank you in advance! Perhaps someone can also recommend me a good beginner Scala / Spark book so my questions can be better ones in the future?</p>