title: How can I avoid this TypeError when creating a new column for my dataframe which multiplies the values in another column
body: <p>I am trying to add a column which converts bitcoin values to GBP to my dataframe in pyspark however when I run the code I get a Type Error. I have tried to create a variable with the same Type as the column to avoid this but I am unable to resolve the error.</p>
  <pre><code>bc_value = DecimalType(&quot;4000&quot;)
  df_j2 = df_j2.withColumn(&quot;value&quot;,df_j2[&quot;value&quot;].cast(DecimalType()))
  df_group = df_j2.groupBy(&quot;pubkey&quot;).sum(&quot;value&quot;)
  df_final = df_group.sort(df_group[&quot;sum(value)&quot;].desc()).limit(10)
  df_with_pound = df_final.withColumn(&quot;pound&quot;, col(bc_value*(&quot;value&quot;)
  df_with_pound.show()
  </code></pre>
  <p>Here is the error shown on screen:</p>
  <p><img src="https://i.stack.imgur.com/9CCCX.png" alt="" /></p>