### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.12 Reference Guide (DRAFT) »
- Spatial algorithms and data structures (`scipy.spatial`) »
- scipy.spatial.KDTree »

# scipy.spatial.KDTree.sparse_distance_matrix

`KDTree.``sparse_distance_matrix`(other, max_distance, p=2.0)

  Compute a sparse distance matrix

  Computes a distance matrix between two KDTrees, leaving as zero any distance greater than max_distance.

  Parameters : | other : KDTree max_distance : positive float p : float, optional
  Returns : | result : dok_matrix Sparse matrix representing the results in “dictionary of keys” format.

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.12 Reference Guide (DRAFT) »
- Spatial algorithms and data structures (`scipy.spatial`) »
- scipy.spatial.KDTree »