title: Filtering Dictionary with List of Lists as Value
body: <p>I have a dictionary with values being a list of lists, e.g.:</p>
  <pre><code>Review_dict[&quot;0002&quot;]
  
  [['0002', '0292', '4', datetime.datetime(1998, 2, 27, 11, 1, 34)],
   ['0002', '0251', '5', datetime.datetime(1998, 2, 27, 12, 2, 24)],
   ['0002', '0050', '5', datetime.datetime(1998, 2, 27, 12, 3, 24)],
   ['0002', '0314', '1', datetime.datetime(1998, 3, 4, 10, 5, 45)]]
  </code></pre>
  <p>I want to remove certain list (within the &quot;big&quot; list), where 2nd element = '0251' or '0314'.</p>
  <p>e.g. Review_dict[&quot;0002&quot;] should become:</p>
  <pre><code>[['0002', '0292', '4', datetime.datetime(1998, 2, 27, 11, 1, 34)],
   ['0002', '0050', '5', datetime.datetime(1998, 2, 27, 12, 3, 24)]]
  </code></pre>
  <p>I have come up with this code but I want to know if there's a simpler/ more elegant way to do so.</p>
  <pre><code>remove = ['0251', '0314']
  
  for key in list(Review_dict):
      for ID in remove:
          for num in range(len(Review_dict[key])):
              if Review_dict[key][num][1] == ID:
                  del Review_dict[key][num]
  </code></pre>