Consider this script:
from intervaltree import IntervalTree
t1 = IntervalTree()
t2 = IntervalTree()
t1[1:3] = "a"
t2[2:3] = "b"
t3 = IntervalTree()
for interval in t1.items():
for overlap_interval in t2.overlap(interval):
t3.add(overlap_interval)
Is this the most efficient way to get an interval tree that only contains intervals that overlap between two interval trees?
Also I would suggest that it should be also possible too use this statment instead of the last loop.
t3.add(t2.overlap(interval)
Consider this script:
Is this the most efficient way to get an interval tree that only contains intervals that overlap between two interval trees?
Also I would suggest that it should be also possible too use this statment instead of the last loop.