# credit to Stack Overflow user in the source link
import pandas as pd
# df is your pandas dataframe
# if already datetime64 you don't need to use to_datetime
df['A'] = pd.to_datetime(df['A'])
df['B'] = pd.to_datetime(df['B'])
df['diff'] = df['A'] - df['B'] # difference in days
import pandas
df = pandas.DataFrame(columns=['to','fr','ans'])
df.to = [pandas.Timestamp('2014-01-24 13:03:12.050000'), pandas.Timestamp('2014-01-27 11:57:18.240000'), pandas.Timestamp('2014-01-23 10:07:47.660000')]
df.fr = [pandas.Timestamp('2014-01-26 23:41:21.870000'), pandas.Timestamp('2014-01-27 15:38:22.540000'), pandas.Timestamp('2014-01-23 18:50:41.420000')]
(df.fr-df.to).astype('timedelta64[h]')