def check_type(data, filetype, rows):
    """
    Takes a 2d list of data, a description of the data of type FileSettings,
    and the number of rows in the data.

    checks the data in each column matches the expected type and converts it to the appropriate variable type
    returns the converted data, a count of any empty cells in the csv file,
    and a count of any unreadable values in the csv file.
    """

    types = filetype.data_types.types
    empty_cell = filetype.delimiters.empty_cell
    data_row = filetype.labels.data_row
    cols = filetype.labels.columns


    null_count = [0] * cols
    error_count = [0] * cols


    for i in range(data_row, rows):
        for j in range(cols):
            if not types[j].check(data[i][j]):
                if empty_cell.match(data[i][j]):
                    null_count[j] += 1
                else:
                    error_count[j] += 1
                data[i][j] = None
            else:
                 data[i][j] = types[j].convert(data[i][j])
    return data, null_count, error_count