create new column based on value count pandas code example
Example 1: pandas count specific value in column
(df[education]=='9th').sum()
Example 2: python count variable and put the count in a column of data frame
df['freq'] = df.groupby('myvar')['myvar'].transform('count')