This started to happen due to changes in the mlxtend library version 0.23.2. It is still unclear whether it is a bug or a feature (open issue). So there are two options to fix that error:
num_itemsets
parameter: rules = association_rules(frequent_items, num_itemsets=len(group_df), metric='confidence',min_threshold=0.7, num_itemsets=2)
. Here I set the parameter to len(group_df)
since docstring is saying it should be to "Number of transactions in original input data".