title: In Pandas, I want to group by a common element and get a list of the elements between them
body: <p>I want to group by a common element and get a list of the elements between them. </p>
  
  <p>The data set i have is below:</p>
  
  <pre><code>pd.DataFrame({'Type': {0: 'S', 1: '1', 2: '3', 3: '3', 4: '2', 5: 'S', 6: '4', 7: 'S', 8: '4', 9: '5', 10: '6', 11: 'S', 12: '2', 13: 'S'}})
  
     Type
  0     S
  1     1
  2     3
  3     3
  4     2
  5     S
  6     4
  7     S
  8     4
  9     5
  10    6
  11    S
  12    2
  13    S
  </code></pre>
  
  <p>I can perform this grouping using more_itertools, but i want to know if there is a more pandaic way to accomplish this task:</p>
  
  <p>Expected output ( I used more_itertools for this, but is there a more pandaic way?)</p>
  
  <pre><code>import more_itertools
  pred = lambda x: x == "S"
  list(more_itertools.split_before(df.T.values.tolist()[0], pred)) 
  
  [['S', '1', '3', '3', '2'],
   ['S', '4'],
   ['S', '4', '5', '6'],
   ['S', '2'],
   ['S']]
  </code></pre>
  
  <p>on a side note, can you use groupby to group between the elements, so each group is just like the output above?</p>