title: concatenate row values for the same index in pandas
body: <p>My initial DataFrame looks as follows:</p>
  
  <pre><code>   A    B  quantity
  0  1  foo         1
  1  1  baz         2
  2  1  bar         2
  3  1  faz         1
  4  2  foo         2
  5  2  bar         1
  6  3  foo         3
  </code></pre>
  
  <p>I need to group it by 'A' and make a list of 'B' multiplied by 'quantity':</p>
  
  <pre><code>   A                               B
  0  1  [foo, baz, baz, bar, bar, faz]
  1  2                 [foo, foo, bar]
  2  3                 [foo, foo, foo]
  </code></pre>
  
  <p>Currently I'm using groupby() and then apply():</p>
  
  <pre class="lang-py prettyprint-override"><code>def itemsToList(tdf, column):
  
      collist = []
      for row in tdf[column].iteritems():
          collist = collist + tdf['quantity'][row[0]]*[row[1]]
  
      return pd.Series({column: collist})
  
  gb = df.groupby('A').apply(itemsToList, 'B')
  </code></pre>
  
  <p>I doubt it is an efficient way, so I'm looking for a good, "pandaic" method to achieve this.</p>