title: How to add node attributes next to node name in Python networkx?
body: <p>I want to draw a bipartite graph connecting colleagues and moviepreferences. How can I show in the graph both the node name (so the moviename or colleague name) and the node attribute (whether it is a colleague or a movie) in the nodes ? </p>
  
  <p>My current code only displays the node attribute and drops the node name. </p>
  
  <p>My code:</p>
  
  <pre><code>BG = nx.Graph()
  BG.add_nodes_from(employees, bipartite=0, _type='employee')
  BG.add_nodes_from(movies, bipartite=1, _type='movie')
  edgeinfo = pd.read_csv('Employee_Movie_Choices.txt', sep='\t')
  edges = [tuple(x) for x in edgeinfo.values]
  BG.add_edges_from(edges)
  
  labels = dict((n,d['_type']) for n,d in BG.nodes(data=True))
  
  %matplotlib notebook
  import matplotlib.pyplot as plt
  
  plt.figure()
  pos = nx.spring_layout(BG)
  edges = BG.edges()
  nx.draw_networkx(BG, pos, edges=edges, labels=labels)
  </code></pre>
  
  <p>If I create label tuples, he gives me an error:</p>
  
  <pre><code>BG = nx.Graph()
  BG.add_nodes_from(employees, bipartite=0, _type='employee')
  BG.add_nodes_from(movies, bipartite=1, _type='movie')
  edgeinfo = pd.read_csv('Employee_Movie_Choices.txt', sep='\t')
  edges = [tuple(x) for x in edgeinfo.values]
  BG.add_edges_from(edges)
  
  labels = dict((n,d['_type']) for n,d in BG.nodes(data=True))  ###ik krijg hier naam movie en employee niet meer bij !!!
  labels_new = [(k, v) for k, v in labels.items()]
  #labels = [tuple(n,d['_type']) for n, d in BG.nodes(data=True)]
  #nx.draw(BG, labels=labels)
  
  %matplotlib notebook
  import matplotlib.pyplot as plt
  
  plt.figure()
  pos = nx.spring_layout(BG)
  edges = BG.edges()
  nx.draw_networkx(BG, pos, edges=edges, labels=labels_new)
  </code></pre>
  
  <p>Error:
  ---> nx.draw_networkx(BG, pos, edges=edges, labels=labels_new)
  AttributeError: 'list' object has no attribute 'items'</p>