I have a dataframe like this
Have been on it 12 days along with 60 mg prozac 4+ years on that. index sentences
1 I feel the best I have felt in years.
2 "I have taken for over 7 years.
3 I slept 2 hours".
4 IT SAVED MY LIFE
5 IT SAVED MY LIFE"
then I want to concatenate them in one array. the problem is that there maybe some sentences reptitive but still I want to keep all of them so the result will be:
["I feel the best I have felt in years", "I have taken for over 7 years." , "I slept 2 hours." , "IT SAVED MY LIFE" , "IT SAVED MY LIFE"]
I have tries this link and this which both are in r.
I have also tried this approach:
dfsent.groupby(['sentences']).apply(','.join)
but as some of the rows in my data frame are repetitive it give me only one of them. in case of my example return me this:
["I feel the best I have felt in years", "I have taken for over 7 years." , "I slept 2 hours." , "IT SAVED MY LIFE" ]
Thanks in advance :)