title: How to subtract two columns of pyspark dataframe and also divide?
body: <p>I have dataframe like this..</p>
  
  <p>dd1 : -</p>
  
  <pre><code>    A    B   
     2112  2637
     1293  2251
     1779  2435
     935   2473
  </code></pre>
  
  <p>I want to substract col B from col A and divide that ans by col A.
  Like this </p>
  
  <pre><code>    A    B       Result 
     2112  2637    -0.24
     1293  2251    -0.74
     1779  2435    -0.36
     935   2473   -1.64
  </code></pre>
  
  <p>Like (2112-2637)/2112 = -0.24</p>
  
  <p>If it is not possible directly then 1st we can perform substract operation and store it new col then divide that col and  store  in another col.</p>