Python Pandas - How to flatten a hierarchical index in columns,df.columns = [' '.join(col).strip() for col in df.columns.values]