title: Python Pandas groupby multiple columns
body: <p>thank you for your help.</p>
  
  <p>I have data that looks like this:</p>
  
  <pre><code>city,  room_type
  A, X
  A, Y
  A, Z
  B, X
  B, Y
  B, Y
  </code></pre>
  
  <p>I want my end result to look like this: <br/></p>
  
  <pre><code>city, count(X), count(Y), count(z) 
  A,  1, 1, 1
  B,  1, 2, 0
  </code></pre>
  
  <p>I am grouping by city and I want to show the count of each room_type in each city. </p>
  
  <p>Any way to do this with python pandas? Thank you. </p>
  
  <p>I learned SQL years ago and think that it may have been possible. I'm sure python can do the same. Thanks!</p>