skbio.tree.BPTree.level_ancestor_batch#
- BPTree.level_ancestor_batch(i, d, engine=None)[source]#
Ancestor a given number of levels above each node in a batch.
The batch counterpart of
level_ancestor: one independent query per element ofi(andd), computed by the selected engine.- Parameters:
- iarray-like of int
Node positions to evaluate.
- dint or array-like of int
Number of levels to ascend, broadcast against
i.- engine{‘cython’, ‘numba’, ‘fast’}, optional
The compute engine. Defaults to the global
compute_engineoption.'fast'is chosen per tree: see the Notes ofBPTree.
- Returns:
- array of intp
level_ancestor(i, d)for each pair, in the broadcast shape ofiandd. Its array backend and device are those ofiandd(seeclose_batch).
See also