title: Get difference values between rows in Pandas DataFrame
body: <p>Hi I have a result set from psycopg2 like so</p>
  
  <pre><code>(
  (timestamp1, val11, val12, val13, val14),
  (timestamp2, val21, val22, val23, val24),
  (timestamp3, val31, val32, val33, val34),
  (timestamp4, val41, val42, val43, val44),
  )
  </code></pre>
  
  <p>I have to return the difference between the values of the row (exception for the timestamp column).
  Each row would subtract the previous row values.
  The first row would be </p>
  
  <p><code>timestamp, 'NaN', 'NaN' ....</code> </p>
  
  <p>This has to then be returned as a generic object
  Ie something like an array of the following objects</p>
  
  <pre><code>Group(timestamp=timestamp, rows=[val11, val12, val13, val14]
  </code></pre>
  
  <p>I was going to use Pandas to do the diff.
  Something like below works ok on the values</p>
  
  <pre><code>df = DataFrame().from_records(data=results, columns=headers)
  diffs = df.set_index('time', drop=False).diff()
  </code></pre>
  
  <p>But diff also performs on the timestamp column and I can't get it to ignore a column while
  leaving the original timestamp column in place.</p>
  
  <p>Also I wasn't sure it was going to be efficient to get the data into my return format
  as Pandas advises against row access </p>
  
  <p>What would a fast way to get the result set differences in my required output format ?</p>