skbio.tree.BPTree.from_npz#

classmethod BPTree.from_npz(file)[source]#

Load a tree from a NumPy .npz archive written by to_npz.

Parameters:
filestr or file-like object

Path or open file handle to read from.

Returns:
BPTree

The reconstructed tree, with node names and branch lengths.

Warning

This method calls numpy.load with allow_pickle=True in order to restore the object-dtype names array. Loading a pickled array can execute arbitrary code, so only read .npz archives from trusted sources.

See also

to_npz
read