[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] uploading a bipartite graph from a csv file
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] uploading a bipartite graph from a csv file |
Date: |
Wed, 20 May 2015 21:17:27 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
> 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.