File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,17 @@ def within_community_degree(weighted_partition):
25
25
node_community = weighted_partition .get_node_community (node )
26
26
within_community_degree = weighted_partition .degree_within_community (node )
27
27
try : # to load average within module degree of community
28
- all_community_degree = all_community_degrees [node_community ]
28
+ community_degrees = all_community_degrees [node_community ]
29
29
except : # collect within module degree of community
30
- all_community_degree = []
30
+ community_degrees = []
31
31
for node in node_community :
32
32
partition .degree_within_community (node )
33
33
all_community_degree .append ()
34
- all_community_degrees [node_community ] = all_community_degree
34
+ all_community_degrees [node_community ] = community_degrees
35
35
# I don't know if it's faster to compute this on the fly every
36
36
# time or store the results in a dictionary?
37
- std = np .std (all_community_degree ) # std of community's degrees
38
- mean = np .mean (all_community_degree ) # mean of community's degrees
37
+ std = np .std (community_degrees ) # std of community's degrees
38
+ mean = np .mean (community_degrees ) # mean of community's degrees
39
39
# z-score
40
40
wc_dict [node ] = (within_community_degree - mean / std )
41
41
return wc_dict
You can’t perform that action at this time.
0 commit comments