values count in python with another column 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')