title: How can I get the table I need?
body: <p>I have a problem with grouping my data. </p>
  
  <p>This is a piece of my dataset, with a few reviews of hospitals and dentists and the year and month of these reviews:</p>
  
  <p><b>Respondent &emsp;  Id nr &emsp; Name &emsp; score  &emsp; year&emsp;   month</b><BR>
  1 &emsp; &emsp; &emsp; &emsp; &emsp;   6665 &emsp; Hospital&emsp;7,0&emsp; &emsp;   2020&emsp; &emsp;   1<BR>
  2 &emsp; &emsp; &emsp; &emsp; &emsp;    6668 &emsp;     Dentist  &emsp;     5,5 &emsp; &emsp;2020&emsp; &emsp;  1<BR>
  3 &emsp; &emsp; &emsp; &emsp; &emsp;    6665 &emsp;     Hospital&emsp;6,8&emsp; &emsp; 2020&emsp; &emsp;    2<BR>
  4 &emsp; &emsp; &emsp; &emsp; &emsp; 6668 &emsp;  Dentist &emsp; 5,7&emsp; &emsp; 2019&emsp;&emsp; 12</p>
  
  <p>When I use this script:</p>
  
  <pre><code>df[['idnumber', 'score', 'respondents' , 'year', 'month',]].groupby('Id nr').agg({'score': 'mean', 'respondents': 'count'}).reset_index()
  </code></pre>
  
  <p>I get the first table that I need:<BR></p>
  
  <p><B>Id nr&emsp; Score &emsp;Respondent</b><bR>
  6665 &emsp; 6,9 &emsp;&emsp;2<BR>
  6668 &emsp; 5,6&emsp; &emsp;2</p>
  
  <p>But now I also want to include 2 extra variabels in the table:<BR>
      1. The column 'Name'. What piece of code can I use here instead of 'mean' or 'count'? <BR>
      2. Then I want to know how many reviews there are in each month of the year.</p>
  
  <p>How can I change the script so I get the table below?</p>
  
  <p><B>Id nr&emsp;Score&emsp;Respondent&emsp;Name&emsp;&emsp;2019 - 12&emsp;2020 - 1&emsp;2020 - 2</B><BR>
  6665&emsp;6,9&emsp;&emsp;&emsp;&emsp;&emsp;2&emsp;&emsp;&emsp;&emsp;Hospital&emsp; &emsp; 
   0&emsp;&emsp;&emsp;&emsp;&emsp;1&emsp;&emsp;&emsp;&emsp;1<BR>
  6668&emsp;5,6&emsp;&emsp;&emsp;&emsp;&emsp;2&emsp;&emsp;&emsp;&emsp;Dentist&emsp;&emsp;&emsp;1&emsp;&emsp;&emsp;&emsp;&emsp;1&emsp;&emsp;&emsp;&emsp;0</p>