count values in a column where column contains pandas code example
Example 1: pd count how many item occurs in another column
df['Counts'] = df.groupby(['Color'])['Value'].transform('count')
Example 2: how to count special values in data in python
df['sex'].value_counts(normalize=True)
Example 3: how to count special values in data in python
df['fare'].value_counts(bins=7)