title: Deleting a dictionary from a list of dictionaries
body: <p>I am trying to delete a dictionary from a list of dictionaries, but unable to achieve it. Here's what I've tried so far:</p>
  
  <pre><code>x = set()         
  for row in comment_data['data']:
      x.add(row['RUNID'])
  for row in data['data']:
      if row['ID'] not in x:
          del row
  </code></pre>
  
  <p>Here data['data'] is a list of dictionaries. x is a set of numbers, I fetch from comment_data. I want to delete the dictionary if row['id'] is not in x. How do I acieve this? Where am I going wrong?
  I tried the answers given on this <a href="https://stackoverflow.com/questions/1235618/remove-dictionary-from-list">link</a>, but none of them seem to work for me. Any help is appreciated!</p>