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 of i (and d), 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_engine option. 'fast' is chosen per tree: see the Notes of BPTree.

Returns:
array of intp

level_ancestor(i, d) for each pair, in the broadcast shape of i and d. Its array backend and device are those of i and d (see close_batch).

See also

level_ancestor