I have some values over time, given in terms of windows like this:
left = [(0, 2, 'foo'), (2, 5, 'bar')]
right = [(1, 3, 'bas'), (3, 4, 'qux')]
And I need to combine them into windows when some pair of values held true, like this:
correct = [(0, 1, 'foo', None), (1, 2, 'foo', 'bas'), (2, 3, 'bar', 'bas'), (3, 4, 'bar', 'qux'), (4, 5, 'bar', None)]
What's the most performant way to do this?
#
programming #
python #
compsci