making new data frame from combining text pandas making new data frame from combining text pandas hadoop hadoop

making new data frame from combining text pandas


IIUC:

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


If without groupby

(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