title: finding duplicates and adding ID as attribute pandas
body: <p>I'm working in geopandas with a large number (around 4.5 million) objects, where each has a unique ID number ('PARCEL_SPI') and also another code ('PC_PLANNO').</p>
  <p>What I would like to do is write some code that, for each object, finds all other objects with the same PLANNO and adds their ID number as a list in a new attribute, say 'Same_code' for the object. The df is called spine_copy.</p>
  <p>Here's a quick sample of what I have:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>PARCEL_SPI</th>
  <th>PC_PLANNO</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>23908</td>
  <td>LP12345</td>
  </tr>
  <tr>
  <td>90435</td>
  <td>LP12345</td>
  </tr>
  <tr>
  <td>329048</td>
  <td>LP90803</td>
  </tr>
  <tr>
  <td>6409</td>
  <td>LP2399</td>
  </tr>
  <tr>
  <td>34534</td>
  <td>LP90803</td>
  </tr>
  <tr>
  <td>092824</td>
  <td>LP12345</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>and what I want out:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>PARCEL_SPI</th>
  <th>PC_PLANNO</th>
  <th>Same_code</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>23908</td>
  <td>LP12345</td>
  <td>[90435, 092824]</td>
  </tr>
  <tr>
  <td>90435</td>
  <td>LP12345</td>
  <td>[23908,092824]</td>
  </tr>
  <tr>
  <td>329048</td>
  <td>LP90803</td>
  <td>34534</td>
  </tr>
  <tr>
  <td>6409</td>
  <td>LP2399</td>
  <td>None</td>
  </tr>
  <tr>
  <td>34534</td>
  <td>LP90803</td>
  <td>329048</td>
  </tr>
  <tr>
  <td>092824</td>
  <td>LP12345</td>
  <td>[23908, 90435]</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I'm not too sure how to do this, but here's my attempt using groupby:</p>
  <pre><code>spine_copy.groupby('PC_PLANNO')['PARCEL_SPI'].apply(list)
  </code></pre>
  <p>However, this doesn't add the list as a new attribute for each object, and I'm unsure how to do this.</p>
  <p>Thanks in advance!</p>