To determine total runtime from excel using python pandas
I tried this using the below option not sure if its the best
NewElapsedTime = time_csv[time_csv['Stage'].str.contains('App')] MaxEndTime = datetime.strptime(max(NewElapsedTime['EndTime'],'%H:%M:%S') MinStartTime = datetime.strptime(max(NewElapsedTime['StartTime'],'%H:%M:%S') print(MaxEndTime - MinStartTime)
Next trying to loop the columns and store these results.
I have the below columns in excel file i need to find the total runtime using python pandas.




Stage
JobName
BaseLineStartTime
BaseLineEndTime
StartTime-2Mar21
EndTime-2Mar21




App1
JobName1
20:00:00
20:11:45
20:05:31
20:18:43


App2
JobName2
20:00:00
20:12:11
20:05:31
20:23:11


App9
JobNamex
20:11:46
20:25:41
20:23:12
20:43:33


Day1
JobName1
20:25:42
20:30:42
20:43:44
20:48:44


Day2
JobName2
20:30:43
20:31:43
20:48:45
20:49:50


Day2
JobName3
20:30:43
20:40:43
20:48:45
20:58:45




Note: I will have more columns based on the runtime dates.
To find the total run time using the logic (App9(EndTime) - App1 (StartTime) & (Day2(EndTime of jobname2 or jobname3 which runs later) - Day1(StartTime)
I need to print the result in below format




Stage
BaseLineRunTime
Runtime-2Mar21




App
00:25:41
00:38:02


Day
00:15:01
00:15:01