I have the following code:
from collections import defaultdict import pandas as pd THRESHOLD = 3 item_counts = defaultdict(int) df = {\'col1\':[\'1 2 3 4