[SciPy-User] KDTree count_neighbors

Sturla Molden sturla@molden...
Fri Jul 2 14:44:35 CDT 2010

elmar skrev:
> Can anyone give me some support ? Any help is wellcome !

You are passing an array instead of a KDTree.

def count_neighbors(self, other, r, p=2.):
        """Count how many nearby pairs can be formed.

        Count the number of pairs (x1,x2) can be formed, with x1 drawn
        from self and x2 drawn from other, and where distance(x1,x2,p)<=r.
        This is the "two-point correlation" described in Gray and Moore 2000,
        "N-body problems in statistical learning", and the code here is based
        on their algorithm.


        other : KDTree

More information about the SciPy-User mailing list