title: remove pairs from nested dictionary that contain a character
body: <p>I have a dictionary in the following format, and I want to keep only <em>unit</em> items that have a <em>negative</em> <em>value</em></p>
  <pre><code>dic = dict(({'a': [{'unit': 'x', 'value': '1', 'type':'int'},{'unit': '19', 'value':'-1', 'input':'man'},{'unit': 'y', 'value':'-2'}],
        'b': [{'unit':'b', 'value': '3', 'type':'int'},{'unit': 'g', 'value':'3'},{'unit': 'tol', 'value':'-12'}]}))
  </code></pre>
  <p>I have this code - where the out variable does print the intended part of the dictionary, but im having trouble appending it back to the correct key and outputting a complete dictionary. Also perhaps an inelegant way of selecting negative, values, is that I am simply selecting fields that contain a '-' in the value pair..</p>
  <pre><code>out=[]
  for k, v in dic.items():
      for x in v:
          if '-' in x['value']:
              out=x
      dic[k].append(dict(out))
  </code></pre>
  <p>the expected dictionary would be like this</p>
  <pre><code>dict(({'a': [{'unit': '19', 'value':'-1', 'input':'man'},{'unit': 'y', 'value':'-2'}],
        'b': [{'unit': 'tol', 'value':'-12'}]}))
  </code></pre>
  <p>thanks for looking</p>