id = df.ix[:, (['names'])]
df.columns = pandas.MultiIndex.from_tuples([tuple(c.split('_')) for c in df
    .columns])
pandas.merge(df.stack(0).reset_index(1), id, left_index=True, right_index=True)
Reshaping dataframes in pandas based on column labels