I have dictinary for emoji sentiment trying to get sentiment from a csv file
I am getting TypeError: unhashable type: 'list'
Please help me to solve it
tokens = tweets['tokens']
averageChangeInSentiment = [ ]
for e in tokens: #mydata
if e in emojisentiment: #sentimentdictionary
if (len(e) > 1):
emoji_sentiment = emojisentiment.get(t, "")
averageChangeInSentiment = sum(emoji_sentiments.values())/len(emoji_sentiment.values())
elif (len(e) == 1):
emoji_sentiment = emojisentiment.get(t, "")
averageChangeInSentiment = emoji_sentiment
elif (len(e) == 0):
averageChangeInSentiment = 0
tweets['emoji_sentiment'] = averageChangeInSentiment