def filter_df_merge(cpu_df, filter_column=None):
    """
    process cpu data frame, merge by 'model_name', 'batch_size'
    Args:
        cpu_df ([type]): [description]
    """
    if not filter_column:
        raise Exception(
            "please assign filter_column for filter_df_merge function")

    df_lists = []
    filter_column_lists = []
    for k, v in cpu_df.groupby(filter_column, dropna=True):
        filter_column_lists.append(k)
        df_lists.append(v)
    final_output_df = df_lists[-1]

    # merge same model
    for i in range(len(df_lists) - 1):
        left_suffix = cpu_df[filter_column].unique()[0]
        right_suffix = df_lists[i][filter_column].unique()[0]
        print(left_suffix, right_suffix)
        if not pd.isnull(right_suffix):
            final_output_df = pd.merge(
                final_output_df,
                df_lists[i],
                how='left',
                left_on=['model_name', 'batch_size'],
                right_on=['model_name', 'batch_size'],
                suffixes=('', '_{0}_{1}'.format(filter_column, right_suffix)))

    # rename default df columns
    origin_column_names = list(cpu_df.columns.values)
    origin_column_names.remove(filter_column)
    suffix = final_output_df[filter_column].unique()[0]
    for name in origin_column_names:
        final_output_df.rename(
            columns={name: "{0}_{1}_{2}".format(name, filter_column, suffix)},
            inplace=True)
    final_output_df.rename(
        columns={
            filter_column: "{0}_{1}_{2}".format(filter_column, filter_column,
                                                suffix)
        },
        inplace=True)

    final_output_df.sort_values(
        by=[
            "model_name_{0}_{1}".format(filter_column, suffix),
            "batch_size_{0}_{1}".format(filter_column, suffix)
        ],
        inplace=True)
    return final_output_df

    process cpu data frame, merge by 'model_name', 'batch_size'
    Args:
        cpu_df ([type]): [description]
    
deploy/benchmark/log_parser_excel.py