igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] igraph R code to Python


From: Tamas Nepusz
Subject: Re: [igraph] igraph R code to Python
Date: Wed, 19 Jan 2011 10:29:28 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7

By the way, if you like the V(lcc) syntax better than lcc.vs, you can
also use that by doing this:

from igraph import VertexSeq as V
from igraph import EdgeSeq as E

-- 
T.

On 01/19/2011 10:04 AM, Simone Gabbriellini wrote:
> Hello List,
>
> in an attempt to translate some code I have in R, I am wondering if this two 
> are equivalent:
>
> R (igraph 0.6):
>
> gclust<-clusters(g, mode='weak')
> lcc<-induced.subgraph(g, V(g)[gclust$membership==1])
> lccusers<-length(V(lcc)[type==FALSE])
> lccthreads<-length(V(lcc)[type==TRUE])"
>
> Python (igraph 0.5.3):
>
> gclust = g.clusters(mode='weak')
> lcc = ggclust.subgraph(idx=1)
> lccusers = len(lcc.vs(type=False))
> lccthreads = len(lcc.vs(type=True))
>
> Best regards,
> Simone
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>



reply via email to

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