title: Trying to replicate countif function from excel to python
body: <p>I'm trying to get the below required output in python</p>
  <p>Input:</p>
  <pre><code>S.No      Name         Marks     
  1        Jack           85       
  2        Ram            75       
  3        Jack           86
  4        Ann            90
  </code></pre>
  <p>Required Output:</p>
  <pre><code>S.No      Name         Marks     Count     
  1        Jack           85       2
  2        Ram            75       1
  3        Jack           86       2
  4        Ann            90       1
  </code></pre>
  <p>i tried the below code to add the count column which is similar to excel workings using countif function
  '''</p>
  <pre><code>data['count']=data['Name'].value_counts()
  </code></pre>
  <p>'''
  this code gives the below output</p>
  <pre><code>S.No      Name         Marks     Count     
  1        Jack           85       NaN
  2        Ram            75       NaN
  3        Jack           86       NaN
  4        Ann            90       NaN
  </code></pre>
  <p>I'm not sure what is missing, Can someone help me in this?
  Really appreciate your help.</p>