title: Group object based on attributes and combine rest of the columns in a list gives me unhashable type: 'list'
body: <p>I am having this object :</p>
  <pre><code>obj = [
      {&quot;mode&quot;:1,&quot;items&quot;:[{&quot;id&quot;:1}],&quot;people&quot;:[{&quot;id&quot;:8888}],&quot;value&quot;:{&quot;v&quot;:1000}},
      {&quot;mode&quot;:1,&quot;items&quot;:[{&quot;id&quot;:1}],&quot;people&quot;:[{&quot;id&quot;:8888}],&quot;value&quot;:{&quot;v&quot;:2000}},
      {&quot;mode&quot;:1,&quot;items&quot;:[{&quot;id&quot;:1}],&quot;people&quot;:[{&quot;id&quot;:9999}],&quot;value&quot;:{&quot;v&quot;:1000}},
      {&quot;mode&quot;:1,&quot;items&quot;:[{&quot;id&quot;:1}],&quot;people&quot;:[{&quot;id&quot;:9999}],&quot;value&quot;:{&quot;v&quot;:2000}}
  ]
  </code></pre>
  <p>and i want to group by <code>mode</code> and <code>items</code> and <code>value</code> and combine <code>people</code> values into a list.</p>
  <p>So the result I want to get is :</p>
  <pre><code>resObj = [
      {&quot;mode&quot;:1,&quot;items&quot;:[{&quot;id&quot;:1}],&quot;people&quot;:[{&quot;id&quot;:8888},{&quot;id&quot;:9999}],&quot;value&quot;:{&quot;v&quot;:1000}}
      {&quot;mode&quot;:1,&quot;items&quot;:[{&quot;id&quot;:1}],&quot;people&quot;:[{&quot;id&quot;:8888},{&quot;id&quot;:9999}],&quot;value&quot;:{&quot;v&quot;:2000}}
  ]
  </code></pre>
  <p>When i do :</p>
  <pre><code>&gt;&gt;&gt; obj = [{&quot;mode&quot;:1,&quot;items&quot;:[{&quot;id&quot;:1}],&quot;people&quot;:[{&quot;id&quot;:8888}],&quot;value&quot;:{&quot;v&quot;:1000}},{&quot;mode&quot;:1,&quot;items&quot;:[{&quot;id&quot;:1}],&quot;people&quot;:[{&quot;id&quot;:8888}],&quot;value&quot;:{&quot;v&quot;:2000}},{&quot;mode&quot;:1,&quot;items&quot;:[{&quot;id&quot;:1}],&quot;people&quot;:[{&quot;id&quot;:9999}],&quot;value&quot;:{&quot;v&quot;:1000}},{&quot;mode&quot;:1,&quot;items&quot;:[{&quot;id&quot;:1}],&quot;people&quot;:[{&quot;id&quot;:9999}],&quot;value&quot;:{&quot;v&quot;:2000}}]
  
  &gt;&gt;&gt; import pandas as pd
  &gt;&gt;&gt; df = pd.DataFrame(obj)
  &gt;&gt;&gt; df.groupby(['items','mode','value'])['people'].apply(list)
  </code></pre>
  <p>i get <code>unhashable type: 'list'</code></p>
  <p>This is expected as <code>people</code> is a list, but how can I achieve what I want? Another problem is that &quot;items&quot; is also a list and I've been reading <code>groupby</code> doesn't work on unhashable types.</p>
  <p>is there a way to achieve the transformation I need?</p>
  <p>EDIT: I've also tried :</p>
  <pre><code>&gt;&gt;&gt; df['items']=df['items'].apply(lambda x: tuple(x))
  &gt;&gt;&gt; df['people']=df['people'].apply(lambda x: tuple(x))
  &gt;&gt;&gt; df.groupby(['items','mode','value'])['people'].apply(list)
  </code></pre>
  <p>but now I get unhashable type <code>dict</code>.</p>