how to check counts of values in python df code example
Example 1: pandas get count of column
df['column_name'].value_counts()
Example 2: pd count how many item occurs in another column
df['Counts'] = df.groupby(['Color'])['Value'].transform('count')