igraph-help
[Top][All Lists]
Advanced

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

[igraph] igraph R code to Python


From: Simone Gabbriellini
Subject: [igraph] igraph R code to Python
Date: Wed, 19 Jan 2011 10:04:35 +0100

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


reply via email to

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