SyntaxFix
Write A Post
Hire A Developer
Questions
If you'd like to overwrite column B in the dataframe, this should work:
df = df.groupby('A',as_index=False).agg(lambda x:'\n'.join(x))