I would like to know which hashtags are used the most in tweets so I did like this
cursor = db.execute("SELECT text FROM myTable WHERE text LIKE '%#%' ")
for row in cursor:
for word in (re.findall(r"#(\w+)", row[0])):
top_hashtags.append(word)
top_hashtags = {i:top_hashtags.count(i) for i in set(top_hashtags)}
print sorted(top_hashtags, key=lambda x: x[0])
The result was wrong .
I used : print sorted(top_hashtags, key=lambda x: x[0])
But I think it is not working like I want .