title: PySpark dynamic column computation
body: <p>Below is my spark data frame</p>
  <pre><code>a b c
  1 3 4
  2 0 0
  4 1 0
  2 2 0
  </code></pre>
  <p>My output should be as below</p>
  <pre><code>a b c
  1 3 4
  2 0 2
  4 1 -1
  2 2 3
  </code></pre>
  <p>Formula is <code>prev(c)-b+a</code> i.e, <code>4-2+0=2</code> and <code>2-4+1=-1</code></p>