Dummy1999
0
Q:

convert 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)
0
seconds = duration.total_seconds()
hours = seconds // 3600
minutes = (seconds % 3600) // 60
seconds = seconds % 60
0
# 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)
0

New to Communities?

Join the community