title: networkx: accessing nodes with multiple node attributes via loop
body: <p>I have a graph which has nodes/edges. 
  I assigned the nodes some attributes </p>
  
  <pre><code> [(1, {'node_rx_signal': 0}),
   (2, {'node_rx_signal': 0}),
   (3, {'node_rx_signal': 1}),
   (4, {'node_rx_signal': 0}),
   (5, {'node_rx_signal': 1}),
   (6, {'node_rx_signal': 0}),
   (7, {'node_rx_signal': 0}),
   (8, {'node_rx_signal': 0})]
  </code></pre>
  
  <p>e.g its is to signify that some nodes have this attribute set to 0 while others don't. 
  With the help of for loop with an If condition I want to carry out a task but I can not seem to access the nodes with <code>'node_rx_signal' == 1</code>.</p>
  
  <pre><code>nx.set_node_attributes(T1,values=0,name='node_rx_signal')
  T1.nodes[3]['node_rx_signal'] = 1
  T1.nodes[5]['node_rx_signal'] = 1  
  
  for n, data in T1:
      if T1[n][data]==1:
          print(T1.node)
          print([n for n in T1.neighbors(n)])
      else:
          pass
  </code></pre>
  
  <p>Something along these lines. </p>