Convert Spark DataFrame to float
<p>I have some DataFrame:</p>

<pre><code>data=[('Alice',1),('Bob',2),('Alice',5)]
</code></pre>

<p>and compute a mean value like this:</p>

<pre><code>value = dataF.groupBy().mean().collect()
</code></pre>

<p>result:</p>

<pre><code>[Row(avg(age)=2.6666666666666665)]
</code></pre>

<p>How can I convert it to float? When I use <code>round</code> function:</p>

<pre><code>print round(value,2)
</code></pre>

<p>I get <code>TypeError: a float is required</code> error.</p>