title: Pandas transform inconsistent behavior for list
body: <p>I have sample snippet that works as expected:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame(data={'label': ['a', 'b', 'b', 'c'], 'wave': [1, 2, 3, 4], 'y': [0,0,0,0]})
  df['new'] = df.groupby(['label'])[['wave']].transform(tuple)
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code>  label  wave  y     new
  0     a     1  0    (1,)
  1     b     2  0  (2, 3)
  2     b     3  0  (2, 3)
  3     c     4  0    (4,)
  </code></pre>
  
  <p>It works analagously, if instead of <code>tuple</code> in transform I give <code>set, frozenset, dict</code>, but if I give <code>list</code> I got completly unexpected result:</p>
  
  <pre><code>df['new'] = df.groupby(['label'])[['wave']].transform(list)
  
    label  wave  y  new
  0     a     1  0    1
  1     b     2  0    2
  2     b     3  0    3
  3     c     4  0    4
  </code></pre>
  
  <p>There is a workaround to get expected result:</p>
  
  <pre><code>df['new'] = df.groupby(['label'])[['wave']].transform(tuple)['wave'].apply(list)
  
    label  wave  y     new
  0     a     1  0     [1]
  1     b     2  0  [2, 3]
  2     b     3  0  [2, 3]
  3     c     4  0     [4]
  </code></pre>
  
  <p>I thought about mutability/immutability (list/tuple) but for set/frozenset it is consistent.</p>
  
  <p>The question is why it works in this way? </p>