count how many time a value in column occur in another column pandas 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')