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