DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
An Interval Mapping Class
A kind of dictionary which allows you to map data intervals to values. Download 'intervalmap' from this <a href=http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/457411>recipe page</a>.
>>> i = intervalmap() >>> i[0:5] = '0-5' >>> i[8:12] = '8-12' >>> print i 0-5 >>> print i 8-12 >>>