df2 = df.groupby(['A']).apply(lambda tdf: pd.Series(dict([[vv, tdf[vv].
    unique().tolist()] for vv in tdf if vv not in ['A']])))
print(df2)
Can pandas groupby aggregate into a list, rather than sum, mean, etc?