Counting the occurrence of each string in a pandas dataframe column
Something Equivalent to this should work:

the function(pandas.Series.str.count) in this link will even make it easier...

You can use split by regex :

#using your sample
df[['class1', 'class2', 'class3',..]] = df['genre'].str.split('|', expand=True)


Alternative to the above method (but iterating the dataframe)

  l = list(df[index-key].values)
  l = (",".join(l))
  l.split('|')


And if need remove column genre add drop:

df = df.drop('genre', axis=1)


And then you can use value_counts()

But this assumes that you have same length of each genre or apply a check first and proceed accordingly..

Or

You can also try using Counter from the collections module(after splitting them, just update each key's value)

example Counter dict 

&gt;&gt;&gt; from collections import Counter
&gt;&gt;&gt; Counter(['apple','red','apple','red','red','pear'])
Counter({'red': 3, 'apple': 2, 'pear': 1})