Thank you very much! Just managed to get it done

Here is what I did

type_list = []
for vertex in g.vs:
if vertex["name"].startswith("#"):
  type_list.append(True)
  else:
  type_list.append(False)

g.vs["type"] = type_list

Perhaps not the best Python code but the projection returns the correct
partitions!

BTW: do you guys keep track of the citations for the sake of funds? I am
happy to provide a list of my own citations unless of course you have
Google Scholar notifies you.

Thanks again,

-Ahmed



On Wed, May 20, 2015 at 3:17 PM, Tamas Nepusz <[email protected]> wrote:

> > reader = csv.DictReader(open("bipartite-test.csv"), dialect="excel")
> > g = igraph.Graph.DictList(vertices=None, edges=reader, directed=False)
> >
> > Now do I need to loop over the g.vs["type"] or there is a quicker way?
> You need to produce a list of length g.vcount() where the i-th element is
> True
> or False and then simply say:
>
> g.vs["type"] = your_list
>
> T.
>
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to