You can use pd.merge_asof , which is a new inclusion starting at 0.19.0 , and also takes a tolerance argument to match +/- that specified amount of time interval.
# Assuming time to be set as the index axis for both df's df1.reset_index(inplace=True) df2.reset_index(inplace=True) df2.loc[pd.merge_asof(df2, df1, on='time', tolerance=pd.Timedelta('1s')).isnull().any(1)]

Please note that the default mapping is performed in the opposite direction, which means that the selection occurs on the last line in the right DataFrame ( df1 ), whose key "on" (which "time" ) is less than or equal to the left ( df2 ). Therefore, the tolerance parameter extends only in this direction (backward), which leads to a range of correspondence - .
In order to be able to 0.20.0 both direct and reverse searches starting from 0.20.0 , this can be achieved using the direction='nearest' argument and include it in the function call. In this regard, tolerance also expanding in both directions, which leads to a bandwidth range of +/- .
source share