Thursday, 22 August 2013

How to align two sets of timestamps

How to align two sets of timestamps

This was a tricky question to name. Here is what I am trying to do: I have
two sets of timestamps. I name the first one t_x and the second one t_y.
For one t_x there are several corresponding t_y's.
For example, take t_x = [1,4,6] and we have t_y[1] = [1,3,7], t_y[4] =
[2,4,6] and t_y[6] = [5,6,7].
This could be plotted in a (t_x, t_y) graph. Now I am taking the set of
slopes, which is (t_y1 - t_y2)/(t_x1 - t_x2), for t_x1 "close" to t_x2 and
t_y1 "close" to t_y2.
The question here is the following: what would be the most time-efficient
way to process the slopes? Is there a good data structure to hold the
timestamps in order to speed up the calculation?
I am using mostly python by the way, but I can read most common languages.

No comments:

Post a Comment