I am trying to create the set of word tokens and a word count dictionary from a dataframe column.
df = pd.DataFrame({'a':[11,11,11,12,12,12], 'b':['The Effect','effective than','more','more','bark oola','a'], 'c': [1,2,3,5,6,9]})
I am now creating tokens from the column 'b' using the code
set(list(itertools.chain.from_iterable(df.b.str.split())))
is this the most efficient way ?
what if I need the tokens and count (number of time that specific token appear in the column) in a dictionary