is there a built in function to compute the overlap between two discrete intervals, e.g. the overlap between [10, 15] and [20, 38]? In that case the overlap is 0. If it\'s
Check out pyinterval http://code.google.com/p/pyinterval/
import interval x=interval.interval[10, 15] y=interval.interval[20, 38] z=interval.interval[12,18] print(x & y) # interval() print(x & z) # interval([12.0, 15.0])