I'm trying to figure out how to get most frequent words per dataframe row - lets say the top 10 most frequent words. I have code that gets me most frequent words for the whole DF, but now I need to be more granular.
import pandas as pd
import numpy as np
df1 = pd.read_csv('C:/temp/comments.csv',encoding='latin-1',names=['client','comments'])
df1.head(3)
Now I can get the most frequent words on the whole df1:
y = pd.Series(' '.join(df1['description']).lower().split()).value_counts()[:10]
how to get that info per df row?
