title: Concatenate pandas dataframe with result of apply(lambda) where lambda returns another dataframe
body: <p>A dataframe stores some values in columns, passing those values to a function I get another dataframe. I'd like to concatenate the returned dataframe's columns to the original dataframe.</p>
  
  <p>I tried to do something like</p>
  
  <pre><code>i = pd.concat([i, i[['cid', 'id']].apply(lambda x: xy(*x), axis=1)], axis=1) 
  </code></pre>
  
  <p>but it did not work with error:</p>
  
  <pre><code>ValueError: cannot copy sequence with size 2 to array axis with dimension 1
  </code></pre>
  
  <p>So I did like this:</p>
  
  <pre><code>def xy(x, y):
      return pd.DataFrame({'x': [x*2], 'y': [y*2]})
  
  df1 = pd.DataFrame({'cid': [4, 4], 'id': [6, 10]})
  print('df1:\n{}'.format(df1))
  
  
  df2 = pd.DataFrame()
  for _, row in df1.iterrows():
      nr = xy(row['cid'], row['id'])
      nr['cid'] = row['cid']
      nr['id'] = row['id']
      df2 = df2.append(nr, ignore_index=True)
  
  print('df2:\n{}'.format(df2))
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>df1:
     cid  id
  0    4   6
  1    4  10
  
  df2:
     x   y  cid  id
  0  8  12    4   6
  1  8  20    4  10
  </code></pre>
  
  <p>The code does not look nice and should work slowly.</p>
  
  <p>Is there pandas/pythonic way to do it properly and fast working?</p>
  
  <p>python 2.7</p>