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 :
df = df.withColumn("logvalue", log(df["prediction_column"]) )
I have already checked the schema of the dataframe and the prediction column is float type. But I keep getting the error that TypeError: a float is required
What am I missing here ? Any suggestions will be of great help