title: pandas get.dummies API usage
body: <p>I have some data in csv and was loading this data using errors = pd.read_csv(&quot;error_data.csv&quot;).
  The data csv contains as below. Now I want to <a href="https://i.stack.imgur.com/5Y3Qd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Y3Qd.png" alt="enter image description here" /></a>
  I tried the following code. But could not succeed.</p>
  <pre><code>errors = pd.read_csv(&quot;error_data.csv&quot;).
  error_count = pd.get_dummies(errors)
  print(error_count)
  error_count.columns = ['datetime', 'machineID', 'error1', 'error2', 'error3', 'error4', 'error5']
  
  error_count = error_count.groupby(['machineID', 'datetime']).sum().reset_index()
  </code></pre>
  <p>CSV Data:</p>
  <pre><code>&quot;datetime&quot;,&quot;machineID&quot;,&quot;errorID&quot;
  2019-01-06 3:00,CuringPress1,&quot;error3&quot;
  2019-02-03 6:00,CuringPress1,&quot;error4&quot;
  2019-02-21 11:00,CuringPress1,&quot;error1&quot;
  2019-02-21 16:00,CuringPress1,&quot;error2&quot;
  2019-03-20 6:00,CuringPress1,&quot;error1&quot;
  2019-04-04 6:00,CuringPress1,&quot;error5&quot;
  2019-05-04 6:00,CuringPress1,&quot;error4&quot;
  2019-05-19 6:00,CuringPress1,&quot;error2&quot;
  2019-05-19 6:00,CuringPress1,&quot;error3&quot;
  2019-06-03 6:00,CuringPress1,&quot;error5&quot;
  2019-06-18 6:00,CuringPress1,&quot;error2&quot;
  2019-06-18 6:00,CuringPress1,&quot;error3&quot;
  2019-08-02 6:00,CuringPress1,&quot;error4&quot;
  2019-08-02 6:00,CuringPress1,&quot;error5&quot;
  2019-10-31 6:00,CuringPress1,&quot;error5&quot;
  2019-11-15 6:00,CuringPress1,&quot;error1&quot;
  2019-12-15 6:00,CuringPress1,&quot;error5&quot;
  2019-01-31 6:00,CuringPress2,&quot;error2&quot;
  2019-01-31 6:00,CuringPress2,&quot;error3&quot;
  2019-04-01 6:00,CuringPress2,&quot;error2&quot;
  2019-04-01 6:00,CuringPress2,&quot;error3&quot;
  2019-04-16 6:00,CuringPress2,&quot;error1&quot;
  2019-04-28 5:00,CuringPress2,&quot;error4&quot;
  2019-05-26 15:00,CuringPress2,&quot;error1&quot;
  2019-05-31 6:00,CuringPress2,&quot;error2&quot;
  2019-05-31 6:00,CuringPress2,&quot;error3&quot;
  </code></pre>