I simply want to merge two dataframes within ±1 min interval.
Here name_df with the sample data set:
Name Date
A 2/19/2019 17:16:15
B 2/19/2019 17:19:46
C 2/19/2019 17:23:03
Another dateframe job_df:
Job Datestamp
Engineer 2/19/2019 17:15:56
Dancer 2/19/2019 17:19:27
Singer 2/19/2019 17:22:44
Here is what I tried to implement but this method misses some rows that went over the other side of the 1 minute(e.g <30 sec rounds down, >30 rounds up):
name_df['Date&Time'] = name_df['Date&Time'].dt.round('1min')
job_df['Date&Time'] = job_df['Date&Time'].dt.round('1min')
merged_df = pd.merge(name_df, job_df, on='Date&Time')
Any help on this is greatly appreciated!