Using pandas, I would like to get count of a specific value in a column.I know using df.somecolumn.ravel() will give me all the unique values and their count.But how to get count of some specific value.
In[5]:df
Out[5]:
col
1
1
1
1
2
2
2
1
Desired :
To get count of 1.
In[6]:df.somecalulation(1)
Out[6]: 5
To get count of 2.
In[6]:df.somecalulation(2)
Out[6]: 3