def col_grid_list_to_str(data, selected_cols, selected_ranges):
    """

    Convert selected columns and selected grid ranges to a string representation.

    Parameters:
        data: (np.array) the original data source.
        selected_cols (list): list of columns selected as indicated by the string.
        selected_ranges (list): list of grid ranges selected as indicated by the string.

        For instance, given the dataset with 5 columns and 184 records, with selected_cols = [1, 4] and selected_ranges = [3, 9],
        the function will return *3**9 ("*" represents "don't care what values are in that column").

    Return:
        a string representing one solution.

    """

    assert (max(selected_cols) < data.shape[
        1]), "ValueError: max column index is {}, exceeded the length of the data = {}!".format(max(selected_cols),
                                                                                                data.shape[1])

    str_list = ["*" for _ in range(data.shape[1])]
    for i in range(len(selected_cols)):
        str_list[selected_cols[i]] = str(selected_ranges[i])

    return "".join(str_list)