def main2(temp_df):
    """helper function that aggregates the input by count and sum for plot_main_4"""
    transformed = temp_df  # time(temp_df)
    label = "loss"

    # print(transformed.columns)
    s = ["Second", label]

    p_sum_agg = transformed.groupby(s)["total_pkts"].agg(["count", "sum"]).reset_index()
    # print(p_sum_agg.columns)

    b_agg = transformed.groupby(s)["total_bytes"].agg(["count", "sum"]).reset_index()

    #     p_agg =  transformed.groupby(s)['total_pkts'].agg(['count', 'sum']).reset_index()
    # print("all aggregations made")
    return [p_sum_agg, b_agg]