Im trying to convert my time to a 12 hour with AM/PM but i keep getting an error and have no idea why. The context is taking the last number of minutes and figuring out what time that ends up being. Here is my code, if anyone could help. It would be wonderful
import numpy as np
import datetime
import time
cumulative_myList = np.cumsum(myList)
time_in_minutes = cumulative_myList[-1]
time_in_seconds = time_in_minutes*60
print(time_in_seconds)
time = datetime.timedelta(0,time_in_seconds)
print(time)
last_bus_time = time.strptime(time, "%H:%M")
last_bus_time.strftime("%I:%M %p")