Created
July 7, 2020 13:22
-
-
Save kurasaiteja/d84aab6de3c28d529b856c74919b41d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates a list of unique Authors - ['Manikanta', 'Teja Kura', .........] | |
l = messages_df.Author.unique() | |
for i in range(len(l)): | |
dummy_df = messages_df[messages_df['Author'] == l[i]] | |
total_emojis_list = list([a for b in dummy_df.emoji for a in b]) | |
emoji_dict = dict(Counter(total_emojis_list)) | |
emoji_dict = sorted(emoji_dict.items(), key=lambda x: x[1], reverse=True) | |
print('Emoji Distribution for', l[i]) | |
author_emoji_df = pd.DataFrame(emoji_dict, columns=['emoji', 'count']) | |
fig = px.pie(author_emoji_df, values='count', names='emoji') | |
fig.update_traces(textposition='inside', textinfo='percent+label') | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment