Pandas pivot table with aggregates from two separate dataframes

I am trying to build a pivot_table that contains the difference in values from two dataframes (df1 and df2)along with the agg mean and standard deviation.
contains df1 =
gender year statistics s_values
male 1999 cigarette use …