I currently have a bunch of times in a column written like "27:32:18", meaning someone was waiting for 27 hours, 32 minutes, and 18 seconds. I keep getting "ValueError: hour must be in 0..23" whenever I try to parse these values.
How should I go about parsing those values or converting them to a more standard format? I tried the following as a test on a single value:
time1 = "56:42:12"
time2 = time1.split(':')
time2 = [int(n) for n in time2]
time2.insert(0, time2[0] // 24)
time2[1] %= 24
At that point, time2 is a list consisting of [2, 8, 42, 12], which is equivalent to 2 days, 8 hours, 42 minutes, and 12 seconds. How would I go about converting that to a Python datetime representation in days, hours, minutes, and seconds in a way that will allow Python to parse it? Note that I will eventually be doing unsupervised clustering on these time values, which represent waiting times.
timedelta()objects.