def create_mapping(df):
    """
    Return a dict that keeps track of duplicated items in a DataFrame
    """
    return (
        df.reset_index()
        .groupby(df.columns.tolist(), dropna=False)["index"]
        .agg(["first", tuple])
        .set_index("first")["tuple"]
        .to_dict()
    )