Answers for "python: calculate number of days from today date in a data frame"

1

python timestamp shift one day

from datetime import datetime, timedelta
print datetime.now() + timedelta(days=5, hours=-5)
Posted by: Guest on May-11-2020
0

python: calculate number of days from today date in a data frame

df[['A','B']] = df[['A','B']].apply(pd.to_datetime) # If conversion required
df['C'] = (df['B'] - df['A']).dt.days
Posted by: Guest on June-22-2020

Code answers related to "python: calculate number of days from today date in a data frame"

Python Answers by Framework

Browse Popular Code Answers by Language