title: pandas pivot table rename columns
body: <p>How to rename columns with multiple levels after pandas pivot operation?</p>
  
  <p>Here's some code to generate test data:</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame({
      'c0': ['A','A','B','C'],
      'c01': ['A','A1','B','C'],
      'c02': ['b','b','d','c'],
      'v1': [1, 3,4,5],
      'v2': [1, 3,4,5]})
  
  print(df)
  </code></pre>
  
  <p>gives a test dataframe: </p>
  
  <pre><code>   c0 c01 c02  v1  v2
  0  A   A   b   1   1
  1  A  A1   b   3   3
  2  B   B   d   4   4
  3  C   C   c   5   5
  </code></pre>
  
  <p>applying pivot</p>
  
  <pre><code>df2 = pd.pivot_table(df, index=["c0"], columns=["c01","c02"], values=["v1","v2"])
  df2 = df2.reset_index()
  </code></pre>
  
  <p>gives</p>
  
  <p><a href="https://i.stack.imgur.com/Tb7hM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Tb7hM.png" alt="output1"></a></p>
  
  <p>how to rename the columns by joining levels?
  with format 
  <code>&lt;c01 value&gt;_&lt;c02 value&gt;_&lt;v1&gt;</code></p>
  
  <p>for example first column should look like 
  <code>"A_b_v1"</code></p>
  
  <p>The order of joining levels  isn't really important to me.</p>