Hi,
to delete vertices with degree==0 use
g.delete_vertices(g.vs(_degree=0))
and you could also do
g.delete_vertices(g.vs(name_notin=set(hashtags)))
Note that set() helps a lot to speed up the lookup.
Il 16/01/2015 14:30, Ahmed Abdeen Hamed ha scritto:
Good morning,
I need to prune vertices in a graph based on a certain criteria (not
in a given list). When doing so, this leaves isolated vertices, which
I also like to remove. But when doing do, delete_vertices() does not
remove all vertices with degree == 0. I am not sure why this is
happening.
I am attaching the script and the data that I am using so you can see
the issue.
Thanks very much,
-Ahmed
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help