title: How to groupby().transform() to value_counts() in pandas?
body: <p>I am processing a pandas dataframe <code>df1</code> with prices of items.</p>
  
  <pre><code>  Item    Price  Minimum Most_Common_Price
  0 Coffee  1      1       2
  1 Coffee  2      1       2
  2 Coffee  2      1       2
  3 Tea     3      3       4
  4 Tea     4      3       4
  5 Tea     4      3       4
  </code></pre>
  
  <p>I create <code>Minimum</code> using:</p>
  
  <pre><code>df1["Minimum"] = df1.groupby(["Item"])['Price'].transform(min)
  </code></pre>
  
  <p>How do I create <code>Most_Common_Price</code>?</p>
  
  <pre><code>df1["Minimum"] = df1.groupby(["Item"])['Price'].transform(value_counts()) # Doesn't work
  </code></pre>
  
  <p>In the moment, I use a multi-step approach:</p>
  
  <pre><code>for item in df1.Item.unique().tolist(): # Pseudocode
   df1 = df1[df1.Price == Item]           # Pseudocode
   df1.Price.value_counts().max()         # Pseudocode
  </code></pre>
  
  <p>which is overkill. There must be a more simple way, ideally in one line</p>
  
  <p><strong>How to groupby().transform() to value_counts() in pandas?</strong></p>