title: NetworkX Get Degree of Node with Weights Applied
body: <p>I'm using NetworkX to create a weighted graph (not a digraph).  Each node has a node name and a number of edges that have a weight.  The weights are always positive, non-zero integers.</p>
  
  <p>What I'm trying to do is get a list of tuples where each tuple represents a node in the graph (by name) and the weighted degree of the node.</p>
  
  <p>I can do something like this:</p>
  
  <pre><code>the_list = sorted(my_graph.degree_iter(),key=itemgetter(1),reverse=True)
  </code></pre>
  
  <p>But this doesn't appear to be taking the weighting of each node into account.  Each node may have a different weight for every edge (or they may be the same, there's no way to know).</p>
  
  <p>Do I need to write a function to do this manually?  I've been coming through the NetworkX docs and am coming up empty on a built-in way to do this (but maybe I'm overlooking it).  </p>
  
  <p>If I have to write the function myself, I'm assuming I use the <code>size()</code> method with the <code>weight</code> flag set.  That seems to only give me the sum of all the weights in the graph though.</p>
  
  <p>Any help is greatly appreciated.</p>