def maxdists(Z):
    Z = np.asarray(Z, order='c', dtype=np.double)
    is_valid_linkage(Z, throw=True, name='Z')

    n = Z.shape[0] + 1
    MD = np.zeros((n - 1,))
    [Z] = _copy_arrays_if_base_present([Z])
    _hierarchy.get_max_dist_for_each_cluster(Z, MD, int(n))
    return MD
Returns the maximum distance between any non-singleton cluster.
dataset/ETHPy150Open scipy/scipy/scipy/cluster/hierarchy.py/maxdists