How to join integers intervals in python?
问题 I have used the module intervals (http://pyinterval.readthedocs.io/en/latest/index.html) And created an interval from a set or start, end tuples: intervals = interval.interval([1,8], [7,10], [15,20]) Which result in interval([1.0, 10.0], [15.0, 20.0]) as the [1,8] and [7,10] overlaps. But this module interprets the values of the pairs as real numbers, so two continuous intervals in integers will not be joined together. Example: intervals = interval.interval([1,8], [9,10], [11,20]) results in: