df = pd.lreshape(df, {'QUEUE': df.columns[df.columns.str.startswith('QUEUE'
    )].tolist()})
piv_df = df.pivot_table(index='QUEUE', columns='HOUR', fill_value=0).stack()
avg_tot = piv_df[['TOTAL_SERVICE_TIME', 'TOTAL_WAIT_TIME']].add_prefix('AVG_')
How to add columns with the average percent and average count to the dataframe?