title: Pandas create new column with count from groupby
body: <p>I have a df that looks like the following:</p>
  
  <pre><code>id        item        color
  01        truck       red
  02        truck       red
  03        car         black
  04        truck       blue
  05        car         black
  </code></pre>
  
  <p>I am trying to create a df that looks like this:</p>
  
  <pre><code>item      color       count
  truck     red          2
  truck     blue         1
  car       black        2
  </code></pre>
  
  <p>I have tried </p>
  
  <pre><code>df["count"] = df.groupby("item")["color"].transform('count')
  </code></pre>
  
  <p>But it is not quite what I am searching for.</p>
  
  <p>Any guidance is appreciated</p>