def union_dicts(d1, d2):
    """Union dictionnaries.
    {1 : 2, 3 : 4} and {1 : 4, 8 : 6} ==> {8: [6], 1: [2, 4], 3: [4]}"""
    df = dict()
    for k in d1:
        df[k] = list([d1[k]])
    for k in d2:
        if k in df:
            df[k].append(d2[k])
        else:
            df[k] = list([d2[k]])
    return df