title: Transforming a list into pyspark dataframe
body: <p>Using pyspark 2.1,I am trying to find some predicted result and the code is given below</p>
  
  <pre><code>restultSet=testingData.map(lambda p: (p.label, linearModel.predict(p.features))).collect()
  </code></pre>
  
  <p>Now the output of restultSet is in list and it looks like below</p>
  
  <pre><code>[(2.0, array([ 2.09078012])), (2.0, array([ 2.09078012])), (2.0, array([ 2.09078012])), (1.0, array([ 2.09078012])), (2.0, array([ 2.09078012])), (1.0, array([ 2.09078012]))]
  </code></pre>
  
  <p>When I am have give type(restultSet) it is showing me below result</p>
  
  <p></p>
  
  <p>I am struggling to convert from list to dataframe</p>
  
  <p>I tried to use below snippets it didn't work . Please help</p>
  
  <pre><code>restultSet.toDF()
  </code></pre>