I try to count the occurences of each emoji (in the emoji library) in my dataframe.
My approach:
emoji_cnt = [[] for i in range(len(list(emoji.UNICODE_EMOJI.keys())))]
j = 0
for key, value in emoji.UNICODE_EMOJI.items():
emoji_cnt[j].append(key)
j = j+1
for k in emoji_cnt:
s = df["Message"].str.count(k[0]).sum()
k.append(s)
actually works. I tried to print the numbers out (within in the Loop) and it works. But some how the programm stops and I get the following Error:
File "C:UsersUSERanaconda3libsre_parse.py", line 668, in _parse
raise source.error("nothing to repeat",
error: nothing to repeat
I am using Spyder on Anaconda and Python 3.8.
Thank you very much guys :)
Kind regards from Vienna!
question from:
https://stackoverflow.com/questions/65848682/error-nothing-to-repeat-when-counting-occurences-in-dataframe 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…