title: Dask groupby and apply : Value error Expected axis has 6 elements, new values have 5 elements
body: <p>I am trying collapse rows of a dataframe based on a key. My file is big and pandas throws a memory error. I am currently trying to use dask. I am attaching the snippet of the code here.</p>
  
  <pre><code>def f(x):
          p = x.groupby(id).agg(''.join).reset_index()
          return p
  metadf = pd.DataFrame(columns=['c1','p1','pd1','d1'])
  df = df.groupby(idname).apply(f, meta=metadf).reset_index().compute()
  </code></pre>
  
  <p><code>p</code> has the same structure as <code>metadf</code>. The shape of both the dataframes are same.
  When I execute this, I get the following error:</p>
  
  <p>"ValueError: Length mismatch: Expected axis has 6 elements, new values have 5 elements"</p>
  
  <p>What am I missing here? Is there any other way to collapse rows based on a key in dask?</p>
  
  <pre><code>The task in hand, to do the following sample in a dask dataframe
  Input csv file :
  key,c1,c2,c3......,cn
  1,car,phone,cat,.....,kite
  2,abc,def,hij,.......,pot
  1,yes,no,is,.........,hello
  2,hello,yes,no,......,help
  
  Output csv file:
  key,c1,c2,c3,.......,cn
  1,caryes,phoneno,catis,.....,kitehello
  2,abchello,defyes,hijno,....,pothelp
  </code></pre>