scipy 1.8.0 Pypi GitHub Homepage
Other Docs
Attributes

Attributes

level : int

The depth of the node. 0 is the level of the root node.

split_dim : int

The dimension along which this node is split. If this value is -1 the node is a leafnode in the kd-tree. Leafnodes are not split further and scanned by brute force.

split : float

The value used to separate split this node. Points with value >= split in the split_dim dimension are sorted to the 'greater' subnode whereas those with value < split are sorted to the 'lesser' subnode.

children : int

The number of data points sorted to this node.

data_points : ndarray of float64

An array with the data points sorted to this node.

indices : ndarray of intp

An array with the indices of the data points sorted to this node. The indices refer to the position in the data set used to construct the kd-tree.

lesser : cKDTreeNode or None

Subnode with the 'lesser' data points. This attribute is None for leafnodes.

greater : cKDTreeNode or None

Subnode with the 'greater' data points. This attribute is None for leafnodes.

This class exposes a Python view of a node in the cKDTree object.

All attributes are read-only.

class cKDTreeNode

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/spatial/_ckdtree.cpython-39-darwin.so#None
type: <class 'type'>
Commit: