Text
0 me así se ds hello
1 me así se ds hello
2 me así se ds
3 me así
I want to add a column to my dataframe (df), above, called 'Emoji Count' based on the number of emojis in each row.
For instance, the first row would have a count of 7 as there are 7 emojis in this row.
I understand that to create a new column based on information in the "Text" column I would enter:
df["Emoji Count"] = df["Text].....
I was able to create a function that counts the number of emojis but I wasn't able to apply this to my dataframe:
def split_count(info):
emoji_list = []
data = regex.findall(r'\X', info)
for word in data:
if any(char in emoji.UNICODE_EMOJI for char in word):
emoji_list.append(word)
return len(emoji_list)