Data Formatting
General Info
Useful Snippets

9.0.9 difference between two dates

Example:

# use pd.Timestamp('your date') to format your date
df['date_time_formated'] - pd.Timestamp('2021-1-20')  # this includes the days

pd.Series(delta.days for delta in (df['date_time_formated'] - pd.Timestamp('2021-1-20 01:00:00') ) )  # difference in days
pd.Series(delta.hours for delta in (df['date_time_formated'] - pd.Timestamp('2021-1-20 01:00:00') ) )  # difference in days
pd.Series(delta.days for delta in (df['date_time_formated'] - pd.Timestamp('2021-1-20 01:00:00') ) )  # difference in days