Counting the column contents for each category, have a set of categories
With df.temp.
df.temp.
You need use regex from here:
df['count'] = df.temp.str.count(r'(?