I have a dataset with two columns: Actual Time and Promised Time (representing the actual and promised start times of some process).
For example:
import pandas as pd
example_df = pd.DataFrame(columns = ['Actual Time', 'Promised Time'],
data = [
('2016-6-10 9:00', '2016-6-10 9:00'),
('2016-6-15 8:52', '2016-6-15 9:52'),
('2016-6-19 8:54', '2016-6-19 9:02')]).applymap(pd.Timestamp)
So as we can see, sometimes Actual Time = Promised Time
, but there are also cases where Actual Time < Promised Time
.
I defined a column that shows the difference between these two columns (example_df['Actual Time']-example_df['Promised Time']
), but the problem is that for the third row it returned -1 day +23:52:00
instead of - 00:08:00
.