def extract_cols_to_nested_dict(df, col1, col2):
    """ From a df of the form col1 | col2 return a nested
        dictionary of the form {col1_val1:[col2_val_a, col2_val_b, col2_val_c],
        col1_val2:[col2_val_a, col2_val_h, col2_val_m}
    """
    nested_dict = {}
    for val in df[col1].unique():
        present_col2_vals = df[df[col1].isin([val])].loc[:, col2].values.tolist()
        nested_dict[val] = present_col2_vals
    return nested_dict