I have a dataframe where each row contains various meta-data pertaining to a single Reddit comment (e.g. author, subreddit, comment text).
I want to do the following
By using sacul's sample data
df['subreddit'].groupby(df['author']).unique().apply(pd.Series) Out[370]: 0 1 author a sr1 sr2 b sr2 NaN