def support(itemset):
    """
    Returns the support value for the given itemset
    itemset is a pandas dataframe with one row per basket, and one column per item
    """

    # Get the count of baskets where all the items are 1
    baskets = itemset.iloc[:,0].copy()
    for col in itemset.columns[1:]:
        baskets = baskets & itemset[col]

    return baskets.sum() / float(len(baskets))