title: From Array[Any] to Array[Double] in scala spark
body: <p>For this code :</p>
  
  <pre><code>var p = result.select("finalFeatures").head.toSeq.toArray
  </code></pre>
  
  <p>The results looks like this :</p>
  
  <pre><code>p: Array[Any] = Array([3.0,6.0,-0.7876947819954485,-0.21757635218517163,0.9731844373162398,-0.6641741696340382,-0.6860072219935377,-0.2990737363481845,-0.7075863760365155,0.8188108975549018,-0.8468559840943759,-0.04349947247406488,-0.45236764452589984,1.0333959313820456,0.609756607087835,-0.7106619551471779,-0.7750330808435969,-0.08097610412658443,-0.45338437108038904,-0.2952869863393396,-0.30959772365257004,0.6988768123463287,0.17049117199049213,3.2674649019757385,-0.8333373234944124,1.8462942520757128,-0.49441222531240125,-0.44187299748074166,-0.300810826687287])
  </code></pre>
  
  <p>I need this to be <code>Array[Double]</code>
  How would i do this ?</p>