I have a dataset with time. Here My first time is 6:00:00 a.m. Here I want to replace every start time into 0 minutes. I checked the answers of "Convert timedelta to total seconds" and the answers are not related to my question. I tried so many replace code. But it didn't work. Can anyone help me to solve this problem? Here I upload the code what I tried?
dataset = pd.read_csv('l.csv')
data= pd.DataFrame(dataset,columns=['date','time'])
dtwithoutseconds = dt.replace(second=0, microsecond=0)
my dataset:
As you can see in the image , in every start time in every day should be the 0 minutes. After replacing the start time into 00:00:00 then add 60 minutes 60 minutes till to next day start time.
start_time = 0 minutes
second_time = 60 minutes
third_time = 120 minutes
till to
next_day start time again = 0 minutes
Error is coming while typing CSMaverick code. Here I upload the image of the error:
According to the cs95 last code, it gave me a big error
dataset = pd.read_csv('l.csv')
data= pd.DataFrame(dataset,columns=['date','time'])
data['time'] -= data.at[0, 'time']; data['time_in_sec'] = data['time'].dt.total_seconds()
print(data['time'])
Error: