[SciPy-User] scipy.KDTree.query ball tree

josef.pktd@gmai... josef.pktd@gmai...
Thu Oct 7 19:04:07 CDT 2010


On Thu, Oct 7, 2010 at 7:51 PM, Peter Tittmann <ptittmann@gmail.com> wrote:
> I'm having some trouble understanding how this query_ball_tree method
> works. The documentation says its parameters are:
>
> other : KDTree
>    The tree containing points to search against
> r : positive float
>    The maximum distance
>
> This is immediately strange to me because it would seem that it needs
> a focal point for the search. I understand that this is a search that
> references an existing KDTree as opposed to the query_ball_tree. So i
> go forth and pass it an existing KDTree:
>
> In [53]: test=spatial.KDTree.query_ball_tree(lasKDTree, 10.)
> ------------------------------------------------------------
> Traceback (most recent call last):
>  File "<ipython console>", line 1, in <module>
> TypeError: query_ball_tree() takes at least 3 arguments (2 given)

since it's a method the first argument should be self, i.e. it should
be called with a KDTree instance and not with the class.

my interpretation.

Josef


>
> It seems that the documentation is missing a parameter. I found an
> obscure reference here:
> http://article.gmane.org/gmane.comp.python.scientific.user/25517/match=query_ball_tree
> that states the the tree should be the second argument. If someone
> could help clarify what the first argument should be I'd be grateful.
>
> Thanks!
>
> Peter
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-User mailing list