I want to merge 2 dataframes (df_a and df_b) on the shared column 'time_stamp'. Both contain floats, however 'time_stamp' in df_a increments by 1, and 'time_stamp' in df_b increments by .33. I want to merge them and aggregate all values of the df_b columns (by max) that fall within df_a time_stamp intervals. Please advise.
df_a
time_stamp data
0.0 b
1.0 b
2.0 c
3.0 a
df_b
time_stamp data_x data_y
0.33 1 0
0.66 0 0
0.99 1 0
1.32 1 3
1.65 1 0
1.98 0 0
2.31 0 0
2.64 0 0
2.97 0 0
This is an example of the desired result:
time_stamp data data_x data_y
0.0 b 1 0
1.0 b 1 3
2.0 c 0 0
3.0 a N/A N/A