title: How to one hot encode with multiple labels in Python?
body: <p>I have a table in CSV that looks something like this:</p>
  
  <pre><code>id   attribute
  1    Canada
  1    United States
  2    Germany
  3    Canada
  4    Germany
  4    United States
  </code></pre>
  
  <p>I want to turn the table above into:</p>
  
  <pre><code>id   attribute.Canada   attribute.UnitedStates   attribute.Germany
  1    1.0                1.0                      0.0
  2    0.0                0.0                      1.0
  3    1.0                0.0                      0.0
  4    0.0                1.0                      1.0
  </code></pre>
  
  <p>I wish to accomplish three things:</p>
  
  <ol>
  <li>each row will have a unique ID</li>
  <li>the values under the "attribute" label become column names that are hot encoded</li>
  <li>export the new table back to CSV</li>
  </ol>