count how many times a value appears in a row python code example
Example 1: pandas count specific value in column
(df[education]=='9th').sum()
Example 2: pd count how many item occurs in another column
df['Counts'] = df.groupby(['Color'])['Value'].transform('count')
Example 3: count how many times a value appears in array python
>>> [1, 2, 3, 4, 1, 4, 1].count(1)
3