df1 = df.pivot_table(index='id', columns='min_max', values='value', aggfunc
    =[np.min, np.max])
df1 = df1.loc[:, ([('amin', 'min_val'), ('amax', 'max_val')])]
How to apply different functions to a groupby object?