Created
October 28, 2015 07:31
-
-
Save mazieres/936c817fc24142c9c696 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
min_freq = 1 | |
min_weight = 3 | |
min_degree = 2 | |
G.remove_edges_from([(u, v, d) for u, v, d in G.edges(data=True) | |
if d['weight'] <= min_weight]) | |
G.remove_nodes_from([n for n, d in G.nodes(data=True) | |
if d['freq'] <= min_freq or | |
len(G[n]) <= min_degree]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment