def MakePregMap(df):
    d = defaultdict(list)
    for index, caseid in df.caseid.iteritems():
        d[caseid].append(index)
    return d
Make a map from caseid to list of preg indices.
dataset/ETHPy150Open AllenDowney/CompStats/nsfg.py/MakePregMap