title: Add the duplicate in another list
body: <p>I want to place the duplicates from one list in another list. In the follow example, I am attempting to create a list <code>red_dup</code> that contains every item that contains a 'red' id that is duplicated. Similarly, I want to do the same for each food in a <code>food_dup</code> list.</p>
  <p>What I have:</p>
  <pre><code>values = [[1, 'red1', 'food4'], [1, 'red2', 'food4'], [1, 'red1', 'food9']]
  </code></pre>
  <p>The result I'm looking for:</p>
  <pre><code>red_dup = [[1, 'red1', 'food4'], [1, 'red1', 'food9']]
  food_dup = [[1, 'red1', 'food4'], [1, 'red2', 'food4']]
  </code></pre>
  <p>In my code the &quot;values&quot; comes from a generator function from a class.</p>
  <p>The function returns these <a href="https://i.stack.imgur.com/I68X1.png" rel="nofollow noreferrer">values</a>.</p>
  <p>The 1 is the distance, and the red or blue is the entity distance from the food.</p>
  <p><a href="https://i.stack.imgur.com/ovYsZ.png" rel="nofollow noreferrer">This</a> is what code returns. The red underline is a X, Y coordinates.</p>