title: python and networkX keyerror
body: <p>i have this problem in python, python keeps giving me an keyerror: weight</p>
  
  <pre><code>  g.add_edge(1,3,weight=2.5)
    g[1][2]['weight'] = 1.5
    for n1,n2,attr in g.edges(data=True):
      print n1,n2,attr['weight']
  </code></pre>
  
  <p>The output.</p>
  
  <pre><code>    KeyError                                  Traceback (most recent call last)
      &lt;ipython-input-56-832c29e7e1db&gt; in &lt;module&gt;()
           2 g[1][2]['weight'] = 1.5
           3 for n1,n2,attr in g.edges(data=True):
     ----&gt; 4      print n1,n2,attr['weight']
  
     KeyError: 'weight'
  
     0 1
  </code></pre>
  
  <p>i dont know why weight gives me an error?</p>