I have the data in the following format (in csv file):
id, review
1, the service was great!
1, staff was friendly.
2, nice location
2, but the place was not clean
2, the motel was okay
3, i wouldn't stay there next time
3, do not stay there
I would like to change the data to the following format:
1, the service was great! staff was friendly.
2, nice location but the place was not clean the motel was okay
3, i wouldn't stay there next time do not stay there
Any help would be appreciated.
1but is appended to the lines before?itertools.groupby.