An Interval Mapping Class
Join the DZone community and get the full member experience.Join For Free
A kind of dictionary which allows you to map data intervals to values. Download 'intervalmap' from this recipe page.
>>> i = intervalmap() >>> i[0:5] = '0-5' >>> i[8:12] = '8-12' >>> print i 0-5 >>> print i 8-12 >>>