pycea.pp.add_depth#
- pycea.pp.add_depth(tdata, key_added='depth', tree=None, copy=False)#
Adds a depth attribute to the tree.
- Parameters:
tdata (
TreeData) – TreeData object.key_added (
str(default:'depth')) – Key to store node depths.tree (
str|Sequence[str] |None(default:None)) – Theobstkey or keys of the trees to use. IfNone, all trees are used.copy (
Literal[True,False] (default:False)) – If True, returns aDataFramewith node depths.
- Return type:
- Returns:
Returns
Noneifcopy=False, else returns node depths.Sets the following fields:
tdata.obs[key_added]Series(dtypefloat)Distance from the root node.
tdata.obst[tree].nodes[key_added]floatDistance from the root node.