I have a data frame with a hierarchical index in axis 1 (columns) (from a groupby.agg operation):
groupby.agg
USAF WBAN year month day s_PC s_CL
A general solution that handles multiple levels and mixed types:
df.columns = ['_'.join(tuple(map(str, t))) for t in df.columns.values]