title: Split list into chunks by condition
body: <p>I have a list like:</p>
  
  <pre><code>["asdf-1-bhd","uuu-2-ggg","asdf-2-bhd","uuu-1-ggg","asdf-3-bhd"]
  </code></pre>
  
  <p>that I want to split into the two groups who's elements are equal after I remove the number:</p>
  
  <pre><code>"asdf-1-bhd", "asdf-2-bhd", "asdf-3-bhd"
  "uuu-2-ggg" , uuu-1-ggg"
  </code></pre>
  
  <p>I have been using <code>itertools.groupby</code> with </p>
  
  <pre><code>for key, group in itertools.groupby(elements, key= lambda x : removeIndexNumber(x)):
  </code></pre>
  
  <p>but this does not work when the elements to be grouped are not consecutive.</p>
  
  <p>I have thought about using list comprehensions, but this seems impossible since the number of groups is not fixed.</p>
  
  <p>tl;dr:</p>
  
  <p>I want to group stuff, two problems:</p>
  
  <ol>
  <li>I don't know the number of chunks I will obtain</li>
  <li>I the elements that will be grouped into a chunk might not be consecutive</li>
  </ol>