def rare_category_replacement(data, column, replace_col, cutoff=3):
    counts = {}
    data[column] = data[column].astype('S100')
    data[replace_col] = data[replace_col].astype('S100')
    for idx in data.index:
        counts[data[column][idx]] = counts.get(data[column][idx], 0) + 1
    
    for idx in data.index:
        if counts[data[column][idx]] < cutoff:
            data[column][idx] = data[replace_col][idx]
    return data
Returns a har file representing the average of multiple har files, each reprenting the same page request. The har
dataset/ETHPy150Open theusual/kaggle-seeclickfix-ensemble/Miroslaw/data_transforms.py/rare_category_replacement--crossover with--dataset/ETHPy150Open linkedin/mobster/src/linkedin/mobster/har/merge.py/merge_by_average