title: Python / pandas group by a column and join the text. Allow repeated grouping variable
body: <p>I am trying to do some text analysis and the sample data is as follows: </p>
  
  <p><a href="https://i.stack.imgur.com/xwiEj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xwiEj.png" alt="enter image description here"></a></p>
  
  <p>What I want is to join the <code>text</code> for a person until the next person appears on <code>name</code> column and conserve the order.</p>
  
  <p>The output should look like: </p>
  
  <pre><code>name    text
  Tom     hello, I am doing good how are you?
  Pink    I am doing good. How is your project going? Any plans this weekend?
  Tom     Hey, no plans this weekend. I am super busy Need to take my daugher to her gymnastics and swimming classes.
  Pink    Alright. Have fun buddy See you later. 
  </code></pre>
  
  <p>So far I have done this: Reproducible Example below </p>
  
  <pre><code>import pandas as pd
  import numpy as np
  dat = pd.DataFrame({'name': {0: 'Tom',
    1: 'tom ',
    2: 'Pink',
    3: 'Pink',
    4: 'Pink',
    5: 'Tom',
    6: 'Tom',
    7: 'Pink',
    8: 'Pink'},
   'text': {0: 'hello, I am doing good',
    1: 'how are you?',
    2: 'I am doing good. ',
    3: 'How is your project going?',
    4: 'Any plans this weekend?',
    5: 'Hey, no plans this weekend. I am super busy',
    6: 'Need to take my daugher to her gymnastics and swimming classes.',
    7: 'Alright. Have fun buddy',
    8: 'See you later. '}})
  dat.groupby(['name'])['text'].apply(''.join)
  </code></pre>
  
  <p>The output I get is </p>
  
  <pre><code>name
  Pink    I am doing good. How is your project going?Any...
  Tom     hello, I am doing goodHey, no plans this weeke...
  tom                                          how are you?
  Name: text, dtype: object
  </code></pre>
  
  <p>This is not what i am looking for. Any help is highly appreciated. </p>