Return a groupby datatable (mean) from previous datatable

Hi @JXS and welcome to the Dash community!

It looks like it just might be a typo…
Try T_means = df_t.to_dict(‘records’) instead of T_means = df_t(‘records’)

If that doesn’t fix it, could you be more specific about what type of error you are seeing?

Note also that you don’t need to have these in two separate callbacks. It can be done in one like this:

@app.callback(
    [Output('main_table', 'data'), Output('brand_active_monthly', 'data')]
    [Input('customer_dropdown', 'value')]
)
def update_table(value):
    dff = pivot_reset[pivot_reset['Customer ID'] == value]

   df_floats_means = dff.groupby(['Transaction Date']).mean(numeric_only=True)
   df_t = df_floats_means.T

    return dff.to_dict('records'), df_t.to_dict('records')

Another thing to check out when you have time is the new dash pivot table. It might be pretty cool in your application. 📣 Dash Pivottable Released