Hi everyone I have two columns in datetime format and I want to make a new column with the elapsed time in days and a second column containing the rest in hours. please see the exemple:
my data :
# importing pandas as pd
import pandas as pd
# creating a dataframe
df = pd.DataFrame({'DATE_IDENTIFIED': ['2019-06-27 10:42:50 ', '2019-06-28 13:11:58', '2019-06-20 13:12:23','2019-06-26 11:14:59','2019-06-26 11:16:04'],
'DATE_CLOSED': ['2019-09-27 10:40:38', '2019-06-28 19:11:22',
'2019-06-28 18:11:22','2019-06-26 13:13:38','2019-06-28 14:15:37']})
DATE_IDENTIFIED DATE_CLOSED
0 2019-06-27 10:42:50 2019-06-27 10:40:38
1 2019-06-28 13:11:58 2019-06-28 13:11:22
2 2019-06-28 13:12:23 2019-06-28 13:11:22
3 2019-06-26 11:14:59 2019-06-26 11:13:38
4 2019-06-26 11:16:04 2019-06-26 11:15:37
Example
DATE_IDENTIFIED DATE_CLOSED days hours
2019-06-27 10:42:50 2019-09-27 10:40:38 90 0
2019-06-28 13:11:58 2019-06-28 19:11:22 0 6
2019-06-20 13:12:23 2019-06-28 18:11:22 8 5
2019-06-26 11:14:59 2019-06-26 13:13:38 0 2
2019-06-26 11:16:04 2019-06-28 14:15:37 2 3