 <p>Your problem is basically in this bit:</p> <pre><code>G.add_edge((s,r), hrc_dict[(s,r)]) </code></pre> <p>networkx interprets this as "add an edge between the first argument <code>(s,r)</code> and the second argument <code>hrc_dict[(s,r)]</code>." So for example <code>('Hillary Clinton', 'Cheryl Mills'): 354</code> becomes an edge between the node <code>('Hillary Clinton', 'Cheryl Mills')</code> and the node <code>354</code>. Instead try</p> <pre><code>G.add_edge(s, r, count = hrc_dict[(s,r)]) </code></pre>