Pandas groupby two columns then get dict for values
<p>I have a pandas dataframe:</p>

<pre><code>banned_titles = 
TitleId  RelatedTitleId
0    89989           32598
1    89989         3085083
2    95281         3085083
</code></pre>

<p>when I apply groupby as following</p>

<pre><code>In [84]: banned_titles.groupby('TitleId').groups
Out[84]: {89989: [0, 1], 95281: [2]}
</code></pre>

<p>This is so close but not I want. </p>

<p>What I want is:</p>

<pre><code>{89989: [32598, 3085083], 95281: [3085083]}
</code></pre>

<p>Is there a way to do this?</p>