title: Find same keys and merge in list of dicts? Python
body: <p>This code produces a list of dictionaries.</p>
  <pre><code> watchlist = r.get_open_option_positions()
      for x in watchlist:
          print('Symbol: {}, Average Price: {}, Quantity: {}'.format(x['chain_symbol'], 
      x['average_price'], x['quantity']))
  </code></pre>
  <p>Output:</p>
  <pre><code>Symbol: PG, Average Price: -46.5714, Quantity: 35.0000
  Symbol: PG, Average Price: 33.7142, Quantity: 35.0000
  Symbol: MSFT, Average Price: -80.0000, Quantity: 6.0000
  Symbol: MSFT, Average Price: 53.0000, Quantity: 6.0000
  </code></pre>
  <p>How do I code the following criteria:</p>
  <pre><code>if symbol is the same and quantity of both symbols is the same, then subtract average prices and multiply by quantity
  </code></pre>
  <p>So for example the result should look like:</p>
  <pre><code>Symbol: PG, Average Price: (-12.8572 * 35), Quantity: 35.000
  Symbol: MSFT, Average Price: (-27 * 6), Quantity: 6.000
  </code></pre>