Cannot create dataframe from list: pyspark
<p>I have a list that is generated by a function. when I execute <code>print</code> on my list:</p>
<pre><code>print(preds_labels)
</code></pre>
<p>I obtain:</p>
<pre><code>[(0.,8.),(0.,13.),(0.,19.),(0.,19.),(0.,19.),(0.,19.),(0.,19.),(0.,20.),(0.,21.),(0.,23.)]
</code></pre>
<p>but when I want to create a <code>DataFrame</code> with this command:</p>
<pre><code>df = sqlContext.createDataFrame(preds_labels, [&quot;prediction&quot;, &quot;label&quot;])
</code></pre>
<p>I get an error message:</p>
<blockquote>
<p>not supported type: type 'numpy.float64'</p>
</blockquote>
<p>If I create the list manually, I have no problem. Do you have an idea?</p>