title: Add nodes with attributes to graph from a dictionary
body: <p>So I have a dictionary and I want to input the keys as nodes into a graph. Then the values of the keys in the dictionary, they have to become attributes of the node. This is my code right now.</p>
  
  <pre><code>dictionary = {1:'a', 2:'b', 3:'c', 4:'d'}
  G.nx.DiGraph()
  G.add_nodes_from(dictionary.keys(), attribute = dictionary.values())
  G.nodes[1]
  &gt;&gt; {'attribute': dict_values(['a', 'b', 'c', 'd'])}
  </code></pre>
  
  <p>This is not the desired output. I actually only want 'a' as attribute from key 1. Desired output is:</p>
  
  <pre><code>G.nodes[1]
  &gt;&gt; {'attribute': 'a'}
  </code></pre>
  
  <p>So the problem is in assigning my attributes. But how can I do this right?</p>