Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
verktoy
PyMetric
Commits
b32bdde8
Commit
b32bdde8
authored
Dec 18, 2018
by
Morten Knutsen
Browse files
Bump to latest networkx and adjust code.
parent
574a83c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
requirements.txt
View file @
b32bdde8
matplotlib
networkx
==
1.11
networkx
==
2.2
gnureadline
utils.py
View file @
b32bdde8
...
...
@@ -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
=
{}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment