def intervals_split_merge(list_lab_intervals):
    """
    对界限列表进行融合

    e.g.
    如['(2,5]', '(5,7]'], 融合后输出为 '(2,7]'

    Parameters:
    ----------
    list_lab_intervals: list, 界限区间字符串列表

    Returns:
    -------
    label_merge: 合并后的区间
    """
    list_labels = []
    # 遍历每个区间, 取得左值右值字符串组成列表
    for lab in list_lab_intervals:
        for s in lab.split(','):
            list_labels.append(s.replace('(', '').replace(')', '').replace(']', ''))
    list_lab_vals = [float(lab) for lab in list_labels]
    # 取得最大最小值的索引
    id_max_val = list_lab_vals.index(max(list_lab_vals))
    id_min_val = list_lab_vals.index(min(list_lab_vals))
    # 取得最大最小值的字符串
    lab_max_interval = list_labels[id_max_val]
    lab_min_interval = list_labels[id_min_val]
    # 如果右边界限的值为+Inf,则改为')', 其他为']'
    l_label = '('
    if lab_max_interval == '+Inf':
        r_label = ')'
    else:
        r_label = ']'
    label_merge = l_label + lab_min_interval + ',' + lab_max_interval + r_label
    return label_merge