Create a pivot table that lists out values : <p>What aggfunc do I need to use to produce a list using a pivot table? I tried using str which doesn't quite work.</p>

<p><strong>Inputs</strong></p>

<pre><code>import pandas as pd
data = {
    'Test point': [0, 1, 2, 0, 1],
    'Experiment': [1, 2, 3, 4, 5]
}
df = pd.DataFrame(data)
print df

pivot = pd.pivot_table(df, index=['Test point'], values=['Experiment'], aggfunc=len)
print pivot

pivot = pd.pivot_table(df, index=['Test point'], values=['Experiment'], aggfunc=str)
print pivot
</code></pre>

<p><strong>Outputs</strong></p>

<pre><code>   Experiment  Test point
0           1           0
1           2           1
2           3           2
3           4           0
4           5           1
            Experiment
Test point            
0                    2
1                    2
2                    1
                                                Experiment
Test point                                                
0           0    1\n3    4\nName: Experiment, dtype: int64
1           1    2\n4    5\nName: Experiment, dtype: int64
2                   2    3\nName: Experiment, dtype: int64
</code></pre>

<p><strong>Desired output</strong></p>

<pre><code>            Experiment
Test point                                                
0           1, 4
1           2, 5
2           3
</code></pre>
