df.groupby('ID').TEXT.apply(' '.join)ID1 Start of document middle end of document2 start of document 2 middle end of document 2Name: TEXT, dtype: object
(df.set_index('ID').TEXT+' ').sum(level=0).str[:-1]Out[1066]: ID1 Start of document middle end of document2 start of document 2 middle end of document 2Name: TEXT, dtype: object