count values of column pandas code example
Example 1: value count in python
col-name.value_count()
Example 2: python count variable and put the count in a column of data frame
df['freq'] = df.groupby('myvar')['myvar'].transform('count')
col-name.value_count()
df['freq'] = df.groupby('myvar')['myvar'].transform('count')