def create_dict(x):
    d = defaultdict(int)
for c in x:
    d[c] += 1
return d
c = df['path'].str.split(',').apply(create_dict)
pd.DataFrame({n: c.apply(lambda x: x[n]) for n in wordlist})
pandas dataframe count row values