I am trying to isolate a specific heading value where time closest matches a datetime64/ timedelta value.
The DF looks like this.
heading times
0 270.00 2016-01-20 21:39:31
1 0.00 2016-01-20 21:39:30
2 270.00 2016-01-20 21:34:15
3 293.36 2016-01-20 21:29:00
4 90.00 2016-01-20 21:28:59
I've created a timedelta, which is times - 10 mins. What i'm trying to do is to get the heading value for the row that is closest to 10 mins ago and compare it to the current heading value. Any thoughts would be appreciated.
Edited to address comment below.
The ultimate result is to compare the heading value to the closest heading value of an arbitrary timedelta (e.g. 10 mins in the past).
So for example comparing the heading value in row 1 with the heading value in row 3 because it is the closest to 10 mins in the past.