title: Count the number of ID - Python
body: <p>I am looking to count the number of time an id occurs a put it in a new column in python</p>
  
  <p>Basically it would be translating this code in R into python</p>
  
  <pre><code>library(dplyr)
  ren2 &lt;- ren2 %&gt;% group_by(ID) %&gt;% mutate(count=n())
  </code></pre>
  
  <p>Thank you</p>