

def _vectorize_counts_and_tree(counts, otu_ids, tree):
    ' Index tree and convert counts to np.array in corresponding order\n    '
    tree_index = tree.to_array(nan_length_value=0.0)
    otu_ids = np.asarray(otu_ids)
    counts = np.atleast_2d(counts)
    counts_by_node = _nodes_by_counts(counts, otu_ids, tree_index)
    branch_lengths = tree_index['length']
    return (counts_by_node.T, tree_index, branch_lengths)

dataset/ETHPy150Open biocore/scikit-bio/skbio/diversity/_util.py _vectorize_counts_and_tree/original