title: Group by client_id and count belonging events in Python
body: <p>I'm new to Python and am dealing with a situation where I have a dataset like this:</p>
  
  <pre><code>client_id    event_name
  123          event_1
  1234         event_1
  123          event_2
  12           event_1
  123          event_1
  </code></pre>
  
  <p>I want to adjust my dataset, so that events are counted per client, like this:</p>
  
  <pre><code>client_id    event_1  event_2
  123          2        1
  1234         1        0
  12           1        0
  </code></pre>
  
  <p>What I'm aiming for is similar to <a href="https://stackoverflow.com/questions/58161230/python-group-by-and-count-multiple-columns">this</a> topic, but my events are in the same column (event_name) and need to be split up in various columns (event_1, event_2, etc).</p>
  
  <p>I have been struggling with this for a day now, and I think that Python probably has a simple solution for this that I currently just don't see. It would be great if somebody could help me out!</p>