Skip to content
Snippets Groups Projects

Adding new methods and the consensual backbone

Merged Ali Yassin requested to merge dev into main
1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
+ 2
1
@@ -45,7 +45,6 @@ def fraction_filter(backbone, value, narrate=True, secondary_property='weight',
filter_by = [backbone.property_name]
ascending = [backbone.ascending]
value = math.ceil(value * len(data))
if backbone.filter_on == 'Edges':
filter_by.append(secondary_property)
@@ -58,9 +57,11 @@ def fraction_filter(backbone, value, narrate=True, secondary_property='weight',
backbone.narrate()
if backbone.filter_on == 'Edges':
value = math.ceil(value * len(data))
return nx.from_pandas_edgelist(data[:value], edge_attr=edge_properties(data))
else:
b = backbone.graph.copy()
value = math.ceil(value * len(backbone.graph))
b.remove_nodes_from(list(data[:value].index))
return b
Loading