We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can i help?
import nltk a = nltk.FreqDist(HT_regular) d = pd.DataFrame({'Hashtag': list(a.keys()), 'Count': list(a.values())})
d = d.nlargest(columns="Count", n = 20) plt.figure(figsize=(16,5)) ax = sns.barplot(data=d, x= "Hashtag", y = "Count") ax.set(ylabel = 'Count') plt.show()
TypeError Traceback (most recent call last) in () 1 import nltk ----> 2 a = nltk.FreqDist(HT_regular) 3 d = pd.DataFrame({'Hashtag': list(a.keys()), 4 'Count': list(a.values())}) 5
3 frames /usr/lib/python3.7/collections/init.py in update(*args, **kwds) 653 super(Counter, self).update(iterable) # fast path when counter is empty 654 else: --> 655 _count_elements(self, iterable) 656 if kwds: 657 self.update(kwds)
TypeError: unhashable type: 'list'
The text was updated successfully, but these errors were encountered:
you can try this for unhashable type : 'list'
import nltk
HT_regular_tuples = [tuple(tag) for tag in HT_regular]
a = nltk.FreqDist(HT_regular_tuples)
d = pd.DataFrame({'Hashtag': list(a.keys()), 'Count': list(a.values())})
Sorry, something went wrong.
No branches or pull requests
Can i help?
import nltk
a = nltk.FreqDist(HT_regular)
d = pd.DataFrame({'Hashtag': list(a.keys()),
'Count': list(a.values())})
selecting top 20 most frequent hashtags
d = d.nlargest(columns="Count", n = 20)
plt.figure(figsize=(16,5))
ax = sns.barplot(data=d, x= "Hashtag", y = "Count")
ax.set(ylabel = 'Count')
plt.show()
TypeError Traceback (most recent call last)
in ()
1 import nltk
----> 2 a = nltk.FreqDist(HT_regular)
3 d = pd.DataFrame({'Hashtag': list(a.keys()),
4 'Count': list(a.values())})
5
3 frames
/usr/lib/python3.7/collections/init.py in update(*args, **kwds)
653 super(Counter, self).update(iterable) # fast path when counter is empty
654 else:
--> 655 _count_elements(self, iterable)
656 if kwds:
657 self.update(kwds)
TypeError: unhashable type: 'list'
The text was updated successfully, but these errors were encountered: