title: set value within groups pandas
body: <p>I'm trying to assign a name to each grouping within pandas.</p>
  
  <p>I have a dataframe, and a list of names:</p>
  
  <pre><code>df = pd.DataFrame({'a':[1, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10],
                     'ids':[234, 345, 456, 444, 333, 22, 11, 5, 1, 2, 3, 4, 6]})
  
  
  names = ['Matt', 'Jeff', 'Steph', 'Shannon']
  </code></pre>
  
  <p>I want to assign these names to each record, round-robin style. So I created a helper function to elongate this list to match the length.</p>
  
  <pre><code>def match_length(list_, length):
      return length//len(list_)*list_+list_[:length%len(list_)]
  
  df['owner'] = match_length(names, len(df))
  
      a  ids    owner
      1  234     Matt
      1  345     Jeff
      2  456    Steph
      2  444  Shannon
      3  333     Matt
      4   22     Jeff
      5   11    Steph
      6    5  Shannon
      7    1     Matt
      7    2     Jeff
      8    3    Steph
      9    4  Shannon
     10    6     Matt
  </code></pre>
  
  <p>The problem I'm running into is that I want to make sure that the same person is assigned to each of the <code>'a'</code> groups. I don't want both 'Matt' and "Jeff' to own the first two records, only Matt should own them. I've tried <code>.groupby()</code> along with <code>.transform()</code>, <code>.apply()</code>, and <code>.assign()</code> with no luck. I'm not sure how to manipulate my list first. It <em>should</em> return..</p>
  
  <pre><code>    a  ids    owner
      1  234     Matt
      1  345     Matt
      2  456     Jeff
      2  444     Jeff
      3  333    Steph
      4   22  Shannon
      5   11     Matt
      6    5     Jeff
      7    1    Steph
      7    2    Steph
      8    3  Shannon
      9    4     Matt
     10    6     Jeff
  </code></pre>