title: Pandas group by returns NAN for apply vs transform function
body: <p>I am into couple of situations that I can't explain myself. First thing is about apply vs transform function. So far I understood, apply works on the whole dataframe whereas transform works on each row, hence slower than apply. So here is my dataframe, </p>
  
  <pre><code>size    id
  40/6    2479
  41/7    2479
  42/8    2479
  43/9    2479
  44/10   2479
  45/11   2479
  46/12   2479
  </code></pre>
  
  <p>Now, when I apply <code>df.groupby('id')['size'].apply(lambda col: ', '.join(col))</code> It returns </p>
  
  <pre><code>0    NaN
  1    NaN
  2    NaN
  3    NaN
  4    NaN
  5    NaN
  6    NaN
  </code></pre>
  
  <p>But if I transform, <code>df.groupby('id')['size'].transform(lambda col: ', '.join(col))</code>, I get</p>
  
  <pre><code>0    40/6, 41/7, 42/8, 43/9, 44/10, 45/11, 46/12
  1    40/6, 41/7, 42/8, 43/9, 44/10, 45/11, 46/12
  2    40/6, 41/7, 42/8, 43/9, 44/10, 45/11, 46/12
  3    40/6, 41/7, 42/8, 43/9, 44/10, 45/11, 46/12
  4    40/6, 41/7, 42/8, 43/9, 44/10, 45/11, 46/12
  5    40/6, 41/7, 42/8, 43/9, 44/10, 45/11, 46/12
  6    40/6, 41/7, 42/8, 43/9, 44/10, 45/11, 46/12
  </code></pre>
  
  <p>I want to make it work with apply since I have 3 Million rows and speed is important factor.</p>
  
  <p><strong>Second issue</strong></p>
  
  <p>When my size data has empty cells, i.e</p>
  
  <pre><code>size    id
          2479
  41/7    2479
          2479
  43/9    2479
  44/10   2479
  45/11   2479
  46/12   2479
  </code></pre>
  
  <p>using either apply or transform, I get this error, 
  <code>TypeError: sequence item 0: expected string, float found</code>
  I understand its due to the null value. My question is, how can I overcome this? I need an union of the available values and ignore the null.</p>