//
sign in
Post
by @danabra.mov
PostEmbed
by @danabra.mov
Record
by @jimpick.com
Record
by @atsui.org
+ new component
Post
[g.subgraph(c).copy() for c in sorted(nx.connected_components(g), key=lambda c: sum([l[-1] for l in g.subgraph(c).copy().edges.data('length')]), reverse=True)] Finally came up with this one line of code.. it gives me #network components ordered by total link length. Is this pythonic? 😅 :networkx: