input is this (it's actually a list, but dict makes it easier to see where 0, 1, 2 are coming from {0:(1870,1900), 1:(1870,1950), 2: (1930,1960)} output is this (.. is 'range') 1870..1899: (0, 1) 1900..1929: (1) 1930..1949: (1, 2) 1950..1959: (2)