title: PySpark: Absolute value of a column. TypeError: a float is required
body: <p>I have a dataframe <code>df</code> created as follow,</p>
  <pre><code>schema = StructType([StructField('Id', StringType(), False),
                       StructField('Value', FloatType(), False)])  
  df = spark.createDataFrame([('a',5.0),('b',1.0),('c',-0.3)],schema)
  </code></pre>
  <p>It looks like</p>
  <pre class="lang-none prettyprint-override"><code>+---+-----+
  | Id|Value|
  +---+-----+
  |  a|  5.0|
  |  b|  1.0|
  |  c| -0.3|
  +---+-----+
  </code></pre>
  <p>Now I want to take absolute value of <code>Value</code>, which should return</p>
  <pre class="lang-none prettyprint-override"><code>+---+-----+
  | Id|Value|
  +---+-----+
  |  a|  5.0|
  |  b|  1.0|
  |  c|  0.3|
  +---+-----+
  </code></pre>
  <p>I've tried</p>
  <pre><code>df = df.withColumn('Value',math.fabs(df.Value))
  </code></pre>
  <p>But it complains <code>TypeError: a float is required.</code> However Value column was specified with <code>FloatType()</code>.</p>
  <p>Any clue on how to correctly do this? Thanks!</p>