[SciPy-user] problem with spatial.kdtree.sparse_distance_matrix

josef.pktd@gmai... josef.pktd@gmai...
Sat Feb 21 11:38:09 CST 2009


On Sat, Feb 21, 2009 at 12:03 PM, Anne Archibald
<peridot.faceted@gmail.com> wrote:
> 2009/2/20  <josef.pktd@gmail.com>:
>> On Fri, Feb 20, 2009 at 5:09 PM,  <josef.pktd@gmail.com> wrote:
>>> I would like to get the distance_matrix of all point in a 2d array,
>>> but it looks like kdtree cannot create a sparse distance matrix with
>>> itself. Is this intentional, a bug, or am I doing something wrong?
>>> Using a small distortion in the data works.
>>> I followed the example in the testfile (BTW: in class
>>> test_sparse_distance_matrix, M is often empty in the examples I tried,
>>> with given r=0.3).
>>>
>>> Josef
>>>
>>
>> The problem is more general:
>> KDTree.sparse_distance_matrix  fails when there are zero distance
>> points in the two trees, even if they are otherwise different.
>
> This was actually a bug in dok_matrix (setting an already-zero element
> to zero failed), which  is now fixed in SVN.
>
> Anne
>

thank you, I will try it out soon.

Josef


More information about the SciPy-user mailing list