I am trying to compare in which index does the timedelta value in one dataframe1 is equal to the timedelta value in another dataframe2 and then trim the dataframe that has more values to make them both start at the same time:
Dataset1:
TimeStamp Col1 ... Col2500
0 days 10:37:34 346 ... 635
0 days 10:38:34 124 ... 546
0 days 10:39:34 346 ... 745
Dataset2:
TimeStamp Col1 ... Col50
0 days 10:25:20 123 ... 789
0 days 10:25:45 183 ... 787
...
...
0 days 10:37:40 223 ... 789
for i in df2.index:
if str(df1.index[0])[7:12] == str(df2.index[i])[7:12]:
index_value = i
break
df2 = df2.drop(df2.index[[0,i-1]])
Expected output will be Dataset2 starting at the same time (nearest to the minute) with Dataset1