Ag grid row span

I want to add aggregation and the calculated value of that column in that same cell.
I’m taking input from dropdown for what type of aggregation i need to apply(sum, average, etc).

 if data == []:
        dff_avg_row = [{}]
    else:
        df = df if data is None else pd.DataFrame(data)
        if aggregation == "sum":
            dff_avg_row = df["completedDots"].sum()
        elif aggregation == "average":
            dff_avg_row = df["completedDots"].mean()
        elif aggregation == "count":
            dff_avg_row = df["completedDots"].count()
        elif aggregation == "min":
            dff_avg_row = df["completedDots"].min()
        elif aggregation == "max":
            dff_avg_row = df["completedDots"].max()
        
        # dff_avg_row["measure_link"] = "Mean"
        sum_dff = aggregation + " " + str(dff_avg_row)
        print("**************************",sum_dff)
        # dashGridOptions={"pinnedBottomRowData": [str(dff_avg_row)]}
        dashGridOptions={"pinnedBottomRowData": [{"measure_link": aggregation,"initiative_link": "",
                                                  "completedDots": '{sum_dff}', "percent_completion":""}]}
        # grid_options["pinnedBottomRowData"] = dff_avg_row
        
        return dashGridOptions

by using this code i get NaN.
I’m want to show sum(calculated_sum) . and the want to apply diferent aggregation or diferent columns.

Hi, got the same issue,
check if pinned row cell value clicked shows right value…
probably the column is numeric and values in pinned row are strings…
I made work around, check if this suits you

def pin_avg_row(data):
    if data == []:
        dff_avg_row = [{}]
    else:
        df_invoice_sum = df_invoicing if data is None else pd.DataFrame(data)
        df_invoice_sum = df_invoice_sum[["invoice_value"]].sum() if data else {'invoice_value':0}
        df_invoice_sum["subtask"] = "Sum"
        df_invoice_sum_dict= df_invoice_sum.to_dict()
        grid_options_patch = Patch()
        grid_options_patch["pinnedBottomRowData"] = [df_invoice_sum_dict]

        return grid_options_patch

but frankly speaking I don’t know how to format this row…add bolding, and change font size…maybe You know?