pandas count single column 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')
df['a'].value_counts()
df['Counts'] = df.groupby(['Color'])['Value'].transform('count')