I have the following dataframe
comments. I have segregated a list of users based on certain conditions. I want to get the count of words based on those users which are named as
gold_users. But I am getting an error in my code
TypeError: unhashable type: 'list'. Please help me fix this.
Id| Text | UserId 6| [2006, course, allen, knutsons, 2001, course, ... | 3 8| [also, theo, johnsonfreyd, note, mark, haimans... | 1
for index,rows in comments.iterrows(): gold_comments = rows[comments.Text.loc[comments.UserId.isin(gold_users)]] Counter(gold_comments)
#Top 10 Words that appear the most in the comments made by gold users with their count. [['scholar',20],['school',18],['bus',15],['class',14],['teacher',14],['bell',13],['time',12],['books',11],['bag',9],'student',7]]