title: Adding a column with logarithm in Dataframe Pyspark
body: <p>I have a dataframe in which I'm trying to add a column which will basically be taking the logarithm of an existing column in the same dataframe. I am trying this :</p>
  
  <pre><code>    df = df.withColumn("logvalue", log(df["prediction_column"]) )
  </code></pre>
  
  <p>I have already checked the schema of the dataframe and the prediction column is float type. But I keep getting the error that 
    <strong>TypeError: a float is required</strong></p>
  
  <p>What am I missing here ? Any suggestions will be of great help</p>