title: Create new columns from unique row values in a pandas dataframe
body: <p>I have a pandas dataframe like :</p>
  
  <pre><code>    yearPassed  policyType  count
  0       1990        1        2000
  1       1990        2        1400
  2       1990        3        1200
  3       1991        3        70
  4       1992        2        1000
  5       1992        3        800
  </code></pre>
  
  <p>I want to make a bar chart, color-coded by policyType column, and showing Year on X-Axis and count on Y-axis.</p>
  
  <p>I tried doing this:</p>
  
  <pre><code>policy_vs_year.plot(x="yearPassed", y=["count", "policyType"], kind="bar")
  plt.show()
  </code></pre>
  
  <p>but this gives a <em>very bad</em> plot.</p>
  
  <p>So I decided to transform my dataframe into something like this (maybe it is easier to plot this way):</p>
  
  <pre><code>    yearPassed       1       2       3
  0       1990       2000    1400     1200
  1       1991        0        0       70
  2       1992        0      1000     800
  </code></pre>
  
  <p>My question is whether it is possible with elementary functions in pandas to achieve this ? (or there are simpler alternatives to plot the dataframe in its original format - without having to reformat it ?)</p>