def scanDataSet(dataset, Ck, minSupport):
    """
    Function to generate Lk from Ck
    :param D: dataset
    :param Ck: candidates of k items
    :param minSupport: value of support value of interest
    :return: return Lk, dict of support values
    """
    # we create a dict of value to count the amount of transaction supported by candidate
    subsetCounter = {}
    for transaction in dataset:
        for candidate in Ck:
            if candidate.issubset(transaction):
                if not candidate in subsetCounter: subsetCounter[candidate]=1
                else: subsetCounter[candidate] += 1
    number_items = float(len(dataset))
    Lk = []
    supportData = {}
    # candidate in Ck are in Lk if they support minimum value
    for subsetCandidate in subsetCounter:
        support = subsetCounter[subsetCandidate] / number_items
        if support >= minSupport:
            Lk.insert(0, subsetCandidate)
        supportData[subsetCandidate] = support
    return Lk, supportData