I have 2 columns in a dataframe. I want to calculate the difference of 2 columns in minutes and write the result into a new column
Input
Planned Pickup date/time Actual Pickup date/time
07/05/2018 09:28:00 07/05/2018 09:33:15
14/05/2018 17:00:00 15/05/2018 08:44:08
15/05/2018 17:00:00 15/05/2018 10:52:50
15/05/2018 17:00:00 15/05/2018 15:03:34
15/05/2018 17:00:00 15/05/2018 15:03:34
16/05/2018 17:00:00 16/05/2018 16:00:38
I want to calculate the difference the actual and planned pickup in minutes and write the result into a new column in dataframe called data['time difference']
Expected Output
Planned Pickup date/time Actual Pickup date/time Time Difference
07/05/2018 09:28:00 07/05/2018 09:33:15 5
14/05/2018 17:00:00 15/05/2018 08:44:08 944
15/05/2018 17:00:00 15/05/2018 10:52:50 -368
15/05/2018 17:00:00 15/05/2018 15:03:34 -117
15/05/2018 17:00:00 15/05/2018 15:03:34 -117
16/05/2018 17:00:00 16/05/2018 16:00:38 -60
How can this done in pandas