[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Confusing behavior of vertex sequence

From: Tim Althoff
Subject: [igraph] Confusing behavior of vertex sequence
Date: Thu, 24 Apr 2014 15:13:48 -0700


I am having some trouble using the graph.vs vertex sequence. I just want to subselect a few nodes (those with high PR) by node ID.
The following minimal examples show how it breaks for me.

Any help is appreciated.


import igraph
print igraph.__version__ # 0.6.5

graph = Graph.Full(10)
# graph = focal_subgraph_directed
print list(graph.vs.select(range(4)))

pr_scores = graph.personalized_pagerank()
pr_scores = np.array(pr_scores)
top_indices = np.argsort(-pr_scores)[:10]
print top_indices, len(top_indices)
print list(graph.vs.select(top_indices)) # Why does this not work and return []?
print list(graph.vs.select([1, 3, 5]))

for i in top_indices:
    print i, focal_subgraph_directed.vs.select(i) # Why does this throw: invalid vertex filter among positional arguments

reply via email to

[Prev in Thread] Current Thread [Next in Thread]