Skip to content

Commit f4ee66b

Browse files
committed
improving Network methods
1 parent c5714d5 commit f4ee66b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed
329 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

art/classes/networks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ def degree_distributions(self, weighted = False, direction = 'all'):
620620

621621

622622

623-
def all_centralities(self, sort_by = ['weighted_degree','degree', 'betweenness','eigencentrality','authority_score','hub_score']):
623+
def all_centralities(self):
624624

625625
"""
626626
Calculates all centrality measures for network. Returns as a Pandas Dataframe.
@@ -676,7 +676,9 @@ def all_centralities(self, sort_by = ['weighted_degree','degree', 'betweenness',
676676
hubs)
677677

678678
if is_directed == True:
679-
sort_by = ['weighted_degree','degree', 'betweenness','authority_score','hub_score']
679+
sort_by = ['weighted_total_degree', 'total_degree', 'betweenness']
680+
else:
681+
sort_by = ['weighted_degree', 'degree', 'betweenness', 'eigencentrality', 'authority_score','hub_score']
680682

681683
return combined.sort_values(sort_by, ascending=False)
682684

0 commit comments

Comments
 (0)