I know that
test = []
for item in my_texts:
test.append(item.encode('ascii', 'ignore').decode('ascii'))
removes emojis from a list. But how can I remove emojis from a dataframe? When I try
a = []
for item in goldtest['Text']:
a.append(item.encode('ascii', 'ignore').decode('ascii'))
I get only the last entry of goldtest. When I try the code on the whole dataframe, I get ''AttributeError: 'DataFrame' object has no attribute 'encode'''
encode
, as your error suggests its a DataFrame