Timedelta docs are here
In [29]: df1 = DataFrame(dict([ ("t{0}".format(i),date_range('20130101 01:0{0}'.format(i*3),periods=5,freq='T')) for i in range(2) ]))
In [30]: df2 = DataFrame(dict([ ("t{0}".format(i+3),date_range('20130101 01:0{0}'.format(i*5),periods=5,freq='T')) for i in range(2) ]))
In [31]: df = df1.join(df2)
In [32]: df
Out[32]:
t0 t1 t3 t4
0 2013-01-01 01:00:00 2013-01-01 01:03:00 2013-01-01 01:00:00 2013-01-01 01:05:00
1 2013-01-01 01:01:00 2013-01-01 01:04:00 2013-01-01 01:01:00 2013-01-01 01:06:00
2 2013-01-01 01:02:00 2013-01-01 01:05:00 2013-01-01 01:02:00 2013-01-01 01:07:00
3 2013-01-01 01:03:00 2013-01-01 01:06:00 2013-01-01 01:03:00 2013-01-01 01:08:00
4 2013-01-01 01:04:00 2013-01-01 01:07:00 2013-01-01 01:04:00 2013-01-01 01:09:00
[5 rows x 4 columns]
In [33]: (df.T-df.T.shift()).T.astype('timedelta64[s]')
Out[33]:
t0 t1 t3 t4
0 NaN 180 -180 300
1 NaN 180 -180 300
2 NaN 180 -180 300
3 NaN 180 -180 300
4 NaN 180 -180 300
[5 rows x 4 columns]
IIRC the astype
requires pandas 0.13.1 (but you can always df.apply(lambda x: x/np.timedelta64(1,'s'))