Commit b32bdde8 authored by Morten Knutsen's avatar Morten Knutsen
Browse files

Bump to latest networkx and adjust code.

parent 574a83c0
......@@ -5,7 +5,7 @@ def reciprocity(G):
"""Calculate reciprocity of graph, i.e. the ratio of the edges in
one direction that have and edge going in the other direction."""
return sum([G.has_edge(e[1], e[0])
for e in G.edges_iter()]) / float(G.number_of_edges())
for e in G.edges]) / float(G.number_of_edges())
def short_names(names):
labels = {}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment