newick = getNewick(node.get_left(), newick, node.dist, leaf_names)
newick = getNewick(node.get_right(), ',%s' % newick, node.dist, leaf_names)
newick = '(%s' % newick
return newick
tree = hierarchy.to_tree(Z, False)
getNewick(tree, '', tree.dist, leaf_names)
Сохранить дендрограмму в формате Newick