df = pd.DataFrame({'author':['a', 'a', 'b'], 'subreddit':['sr1', 'sr2', 'sr2']}) >>> df author subreddit 0 a sr1 1 a sr2 2 b sr2 ...