count value from row 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')