def get_prefix(cols, unique_col):
    """
    Extracts a prefix from the column names

    :param cols: The name of the columns
    :type cols: list
    :param unique_col: A unique column
    :type unique_col: str
    :return: The prefix of all columns
    :rtype: str
    """
    for c in cols:
        if unique_col in c:
            return c.split(unique_col)[0]
    return ''
