I\'ve got a data frame, df, with three columns: count_a, count_b and date; the counts are floats, and the dates are conse
df
count_a
count_b
date
diff should give the desired result:
diff
>>> df.diff() count_a count_b 2015-01-01 NaN NaN 2015-01-02 38465 NaN 2015-01-03 36714 NaN 2015-01-04 35137 NaN 2015-01-05 35864 NaN .... 2015-02-07 142390 25552 2015-02-08 126768 22835 2015-02-09 122324 21485