title: Python Pandas: Rename columns after pivoting
body: <p>I have a pandas dataframe that is pivoted. I do not know how to change column names so that I can continue working with the pivoted dataframe in a natural way. Below is a minimal working example. </p>
  
  <pre><code>df = pd.DataFrame({'foo': ['one', 'one', 'one', 'two', 'two',
                              'two'],
                      'bar': ['A', 'B', 'C', 'A', 'B', 'C'],
                      'baz': [1, 2, 3, 4, 5, 6],
                      'zoo': ['x', 'y', 'z', 'q', 'w', 't']})
  </code></pre>
  
  <p>After pivoting with </p>
  
  <pre><code>df.pivot(index='foo', columns='bar', values=['baz', 'zoo'])
  </code></pre>
  
  <p>the output is:</p>
  
  <pre><code>      baz       zoo
  bar   A  B  C   A  B  C
  foo
  one   1  2  3   x  y  z
  two   4  5  6   q  w  t
  </code></pre>
  
  <p>What would be the following step to do in order to obtain below output?</p>
  
  <pre><code>   A_baz  B_baz  C_baz   A_zoo  B_zoo  C_zoo
  
  one   1    2       3       x      y      z
  two   4    5       6       q      w      t
  </code></pre>
  
  <p>Thanks a lot!</p>