title: Check if a node with the same label exists in networkx in python
body: <p>I am using the following code to build my graph using  networkx as follows.</p>
  
  <pre><code>mylist = [('chocolate_pudding', 6.3), ('tim_tam', 178.5), ('bread', 3.5), 
  ('chocolate_pudding', 8.5), ('tim_tam', 3.0), ('butter', 204.0)]
  
  G = nx.Graph()
  
  for ele in mylist:
      #if node with ele[0] does not exists, add the new node
           G.add_node(ele[0], weight=ele[1])
      #else, update the weight with the new weight value (weight = existing_weight + ele[1])
  </code></pre>
  
  <p>I want to check if the node with the same label exists before creating a new node. If the node exists I want to update its weight by adding the new value to the existing value.</p>
  
  <p>For example in the above example, I want only 4 nodes <code>chocolate_pudding, tim_tam, bread, butter</code> and their weight should be <code>14.8, 181.5, 3.5, 204.0</code> respectively.</p>
  
  <p>I did not find a proper way of doing this in networkx. hence please let me know if this is possible to do in networkx?</p>