title: Pandas - Pivot and Rearrange Table With Multiple Labels in Same Header
body: <p>I have an xlsx file with tabs for multiple years of data. Each tab contains a table with many columns and the table is structured like this:</p>
  
  <pre><code>+-----------+-------+-------------------------+----------------------+
  |   City    | State | Number of Drivers, 2019 | Number of Cars, 2019 |
  +-----------+-------+-------------------------+----------------------+
  | LA        | CA    |                     123 |                 10.0 |
  | San Diego | CA    |                     456 |                 2345 |
  +-----------+-------+-------------------------+----------------------+
  </code></pre>
  
  <p>I would like to rearrange the table to look like this, and do it for each tab in the xlsx:</p>
  
  <pre><code>+-----------+-------+------+-------------------+---------------+
  |   City    | State | Year |   Measure Name    | Measure Value |
  +-----------+-------+------+-------------------+---------------+
  | LA        | CA    | 2019 | Number of Drivers |           123 |
  | San Diego | CA    | 2019 | Number of Drivers |           456 |
  | LA        | CA    | 2019 | Number of Cars    |            10 |
  | San Diego | CA    | 2019 | Number of Cars    |          2345 |
  +-----------+-------+------+-------------------+---------------+
  </code></pre>
  
  <p>There are a lot of moving pieces to this and has been a little tricky to get the final formatting correct. </p>