title: Creating columns out of categorical variables with values from two other columns in pandas
body: <p>Original dataframe</p>
  
  <p><a href="https://i.stack.imgur.com/WT8Cj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WT8Cj.png" alt="enter image description here"></a></p>
  
  <p>I want it to transform into the following structure:</p>
  
  <pre><code>Area   |Ind3_2016|Ind6_2016|...|Ind12_2016|Ind3_2017|Ind6_2017|...| Ind12_2017
  -------|---------|---------|---|----------|---------|---------|---|-----------
  Alabama| 2306    | 2270    |...| 35621    | 2409    | 3391    |...| 36397  
  </code></pre>
  
  <p>Create columns out of every unique value in IndCode column for 2016 and 2017 and place values of 2016 and 2017 column under these columns.</p>