def _header_name(channel_name: str, i_bin: int, *, unique: bool = True) -> str:
    """Constructs the header name for a column in a yield table.

    There are two modes: by default the names are unique (to be used as keys). With
    ``unique=False``, the channel names are skipped for bins beyond the first bin (for
    less redundant output).

    Args:
        channel_name (str): name of the channel (phase space region)
        i_bin (int): index of bin in channel
        unique (bool, optional): whether to return a unique key, defaults to True

    Returns:
        str: the header name to be used for the column
    """
    if i_bin == 0 or unique:
        header_name = f"{channel_name}\nbin {i_bin+1}"
    else:
        header_name = f"\nbin {i_bin+1}"
    return header_name