igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] How to Create a Weight List using Python for Modularity()


From: Tamás Nepusz
Subject: Re: [igraph] How to Create a Weight List using Python for Modularity()
Date: Fri, 21 Feb 2014 20:34:58 +0100

> I am trying to use modularity(), but i don't know how to create a weight list 
> for the WEIGHT parameter. How can you do this?

If the edges of your graph already have a “weight” edge attribute, just use 
that:

q = g.modularity(membership, weights=g.es[“weight”])

Otherwise, construct a list where item i is the weight of edge i and use that.

T.





reply via email to

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