count number of times a value appears in a column pandas code example
Example 1: number of times a value occurs in dataframne
df['a'].value_counts()
Example 2: pd count how many item occurs in another column
df['Counts'] = df.groupby(['Color'])['Value'].transform('count')