[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] average nearest neighbor degree in python
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] average nearest neighbor degree in python |
Date: |
Tue, 6 Apr 2010 22:30:54 +0100 |
> Can I use the knn function in python?
There's no interface for it yet (there will be in 0.6, probably), but it's easy
to implement it yourself:
def knn(g):
n = g.vcount()
return [sum(g.degree(g.neighbors(i))) / float(g.degree(i)) for i in xrange(n)]
--
Tamas