def _only_contigous_subexons(subexon_table):
    """Return True if the subexons should be merged."""
    subexon_table = subexon_table.sort_values(by='SubexonRank', ascending=True)
    indices = subexon_table.index
    n_rows = len(indices)
    to_keep = [[]]
    group = 0
    if n_rows > 1:
        for i in range(1, n_rows):
            rowi = indices[i - 1]
            rowj = indices[i]
            if subexon_table.at[rowi, 'Strand'] == 1:
                merge = subexon_table.at[rowj, 'SubexonCodingStart'
                    ] - subexon_table.at[rowi, 'SubexonCodingEnd'] == 1
            else:
                merge = subexon_table.at[rowi, 'SubexonCodingEnd'
                    ] - subexon_table.at[rowj, 'SubexonCodingStart'] == 1
            if merge:
                if rowi not in to_keep[group]:
                    to_keep[group].append(rowi)
                to_keep[group].append(rowj)
            else:
                to_keep.append([])
                group += 1
    return [subexon_table.loc[(group), :] for group in to_keep]
