title: NetworkX: how to assign the node coordinates as attribute?
body: <p>In a simple graph like this:</p>
  
  <pre><code>import networkx as nx
  import matplotlib.pyplot as plt
  
  G = nx.Graph()
  G.add_edge('0','1')
  G.add_edge('1','2')
  G.add_edge('2','0')
  G.add_edge('0','3')
  G.add_edge('1','4')
  G.add_edge('5','0')
  
  pos={'0':(1,0),'1':(1,1),'2':(2,3),'3':(3,2),'4':(0.76,1.80),'5':(0,2)} #node:(x,y)
  nx.draw(G,pos=pos,with_labels=True)
  plt.show()
  </code></pre>
  
  <p>if I try to assign each node a list of attributes containing the node ID and its <code>(x,y)</code> coordinates like this:</p>
  
  <pre><code>for i,n in enumerate(G.nodes()):
      G.nodes()[i]['weight']=[G.nodes()[i],pos[n]] #List of attributes
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-47-0f9ca94eeefd&gt;", line 2, in &lt;module&gt;
      G.nodes()[i]['weight']=[G.nodes()[i],pos[n]] 
  
  TypeError: 'str' object does not support item assignment
  </code></pre>
  
  <p>What is wrong here?</p>