ragtag_utilities/ScaffoldGraph.py
def filter_by_weight(self, w):
        """
        Remove edges with weight less than w.
        :param w: The minimum edge weight
        """
        G = nx.Graph()

        for u, v in self.edges:
            if self.graph[u][v]["weight"] >= w:
                # Add the nodes first in case they have data
                G.add_node(u, **self.nodes(data=True)[u])
                G.add_node(v, **self.nodes(data=True)[v])
                G.add_edge(u, v, **self.graph[u][v])

        self.graph = G

        Remove edges with weight less than w.
        :param w: The minimum edge weight
        
Remove edges with weight less than w.
Remove edges with weight less than w .
def filter_by_weight(self, w):
        G = nx.Graph()
        for u, v in self.edges:
            if self.graph[u][v]["weight"] >= w:
                G.add_node(u, **self.nodes(data=True)[u])
                G.add_node(v, **self.nodes(data=True)[v])
                G.add_edge(u, v, **self.graph[u][v])
        self.graph = G
def filter_by_weight ( self , w ) : G = nx . Graph ( ) for u , v in self . edges : if self . graph [ u ] [ v ] [ "weight" ] >= w : G . add_node ( u , ** self . nodes ( data = True ) [ u ] ) G . add_node ( v , ** self . nodes ( data = True ) [ v ] ) G . add_edge ( u , v , ** self . graph [ u ] [ v ] ) self . graph = G
Remove edges with weight less than w.
Remove edges with weight less than w .
"""
        Remove edges with weight less than w.
        :param w: The minimum edge weight
        """ # Add the nodes first in case they have data
self
w
The minimum edge weight
The minimum edge weight