pandas timedelta to seconds
df['column_with_timedelta'].dt.total_seconds()
pandas timedelta to seconds
df['column_with_timedelta'].dt.total_seconds()
converting pandas._libs.tslibs.timedeltas.Timedelta to days
# Convert TimeDelta column (5 days etc.) into an integer column (5)
import numpy as np
df.timeDelta = (df.timeDelta / np.timedelta64(1,'D')).astype(int)
timedelta64 total_mins
import datetime
def minutes(date_time_older, date_time_newer):
date_time_difference = round((date_time_newer-date_time_older).total_seconds()/60)
return date_time_difference
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us