Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created April 9, 2021 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/fcb5acb121178eab4d1d7f88713ee3d9 to your computer and use it in GitHub Desktop.
Save amankharwal/fcb5acb121178eab4d1d7f88713ee3d9 to your computer and use it in GitHub Desktop.
def split_count(text):
emoji_list = []
data = regex.findall(r'\X',text)
for word in data:
if any(char in emoji.UNICODE_EMOJI for char in word):
emoji_list.append(word)
return emoji_list
df['emoji'] = df["Message"].apply(split_count)
emojis = sum(df['emoji'].str.len())
print(emojis)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment