title: lambda rdd.map gives: TypeError: unsupported operand type(s) for -: 'Row' and 'float'
body: <p>rdd.map gives: TypeError: unsupported operand type(s) for -: 'Row' and 'float'</p>
  
  <p>I create an rdd from a dataframe using:</p>
  
  <pre><code>temprdd = df.select('results').rdd
  </code></pre>
  
  <p>Then I want to do a calculation on all the objects in it (basically in my 'results' column which I now think is its own rdd):</p>
  
  <pre><code>sqrt(temprdd.map(lambda x : pow(x-mean,2)).sum())
  </code></pre>
  
  <p>But I'm getting:</p>
  
  <blockquote>
    <p>File "/usr/local/src/spark20master/spark/python/pyspark/rdd.py", line
    999, in 
        return self.mapPartitions(lambda x: [sum(x)]).fold(0, operator.add)   File "", line 7, in
     TypeError: unsupported operand type(s) for -: 'Row' and
    'float'</p>
  </blockquote>
  
  <p>My mean is a float.  The value I'm expecting the x to be is a float; but is read as a Row I guess. What oh what am I doing wrong? Thanks. </p>