title: Rolling subtraction in pandas
body: <p>I am trying do something like that.</p>
  
  <pre><code>ff = pd.DataFrame({'uid':[1,1,1,20,20,20,4,4,4],
                     'date':['09/06','10/06','11/06',
                             '09/06','10/06','11/06',
                             '09/06','10/06','11/06'],
                     'balance':[150,200,230,12,15,15,700,1000,1500],
                    'difference':[np.NaN,50,30,np.NaN,3,0,np.NaN,300,500]})
  </code></pre>
  
  <p>I have tried with rolling, but I cannot find the function or the rolling sub-class that subtracts, only sum and var and other stats.
  Is there a way?
  I was thinking that I can create two <code>df</code>s: one - with the first row of every uid eliminated, the second one - with the last row of every uid eliminated. But to be honest, I have no idea how to do that dynamically, for every uid.</p>