igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] uploading a bipartite graph from a csv file


From: Ahmed Abdeen Hamed
Subject: Re: [igraph] uploading a bipartite graph from a csv file
Date: Wed, 20 May 2015 15:07:44 -0400

Thank you!

I am a bit rusty on the syntax. Here is what I did:

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?

Thanks very much,

-Ahmed




On Wed, May 20, 2015 at 5:59 AM, Tamas Nepusz <address@hidden> wrote:
> Is uploading a bipartite graph from a .csv value file any different from
> any other graph? If so, how would one specify the partitions? Say the
> source is part1 and target is part2?

Bipartite graphs in igraph are treated just like any other graph; the only
difference is that you should have a vertex attribute named "type" which
contains TRUE for one of the vertex groups and FALSE for the other. If you are
loading a graph from a CSV file, you can add this vertex attribute after
loading.

T.


reply via email to

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